gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r11680: Fix regression.


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r11680: Fix regression.
Date: Thu, 10 Dec 2009 16:50:35 +0100
User-agent: Bazaar (2.0.2)

------------------------------------------------------------
revno: 11680 [merge]
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Thu 2009-12-10 16:50:35 +0100
message:
  Fix regression.
  
  Use time, not branch count, to interrupt script execution. This still needs
  to be settable in gnashrc; implementing a dialog box in the GUI would
  also be a good idea.
modified:
  libbase/GnashAlgorithm.h
  libbase/string_table.cpp
  libbase/string_table.h
  libcore/MovieClip.cpp
  libcore/PropertyList.cpp
  libcore/SystemClock.cpp
  libcore/SystemClock.h
  libcore/abc/Class.h
  libcore/asobj/flash/display/MovieClip_as.cpp
  libcore/asobj/flash/system/System_as.cpp
  libcore/namedStrings.cpp
  libcore/swf/DefineFontAlignZonesTag.cpp
  libcore/vm/ActionExec.cpp
  libcore/vm/ActionExec.h
=== modified file 'libbase/GnashAlgorithm.h'
--- a/libbase/GnashAlgorithm.h  2009-09-15 06:35:30 +0000
+++ b/libbase/GnashAlgorithm.h  2009-12-09 11:51:40 +0000
@@ -89,6 +89,14 @@
 }
 
 
+/// Get the size of an array without passing a pointer by mistake
+template<typename T, size_t N>
+size_t
+arraySize(T(&)[N])
+{
+    return N;
+}
+
 
 /// Delete a pointer safely
 //

=== modified file 'libbase/string_table.cpp'
--- a/libbase/string_table.cpp  2009-03-04 20:30:04 +0000
+++ b/libbase/string_table.cpp  2009-12-09 12:19:39 +0000
@@ -43,11 +43,9 @@
                to_find = &t_f;
                
        // Empty strings all map to 0
-       if (to_find->empty())
-               return 0;
+       if (to_find->empty()) return 0;
 
-       table::nth_index<0>::type::iterator i =
-               mTable.get<0>().find(*to_find);
+       table::nth_index<0>::type::iterator i = mTable.get<0>().find(*to_find);
 
        if (i == mTable.end())
        {
@@ -98,29 +96,22 @@
 }
 
 void
-string_table::insert_group(svt* pList, std::size_t size)
+string_table::insert_group(const svt* l, std::size_t size)
 {
        boost::mutex::scoped_lock aLock(mLock);
 
        for (std::size_t i = 0; i < size; ++i)
        {
-               if (mSetToLower)
-               {
-                       boost::to_lower(pList[i].mValue);
-                       boost::to_lower(pList[i].mComp);
-               }
-               else if (mCaseInsensitive)
-               {
-                       boost::to_lower(pList[i].mComp);
-               }
+        // Copy to avoid changing the original table.
+        svt s = l[i];
+        if (mCaseInsensitive) boost::to_lower(s.mComp);
 
                // The keys don't have to be consecutive, so any time we find a 
key
-               // that is too big, jump a few keys to avoid rewriting this on 
every item.
-               if (pList[i].mId > mHighestKey)
-                       mHighestKey = pList[i].mId + 256;
-               mTable.insert(pList[i]);
+               // that is too big, jump a few keys to avoid rewriting this on 
every
+        // item.
+               if (s.mId > mHighestKey) mHighestKey = s.mId + 256;
+               mTable.insert(s);
        }
-       mSetToLower = false;
 }
 
 string_table::key

=== modified file 'libbase/string_table.h'
--- a/libbase/string_table.h    2009-02-25 22:33:03 +0000
+++ b/libbase/string_table.h    2009-12-09 12:19:39 +0000
@@ -113,8 +113,6 @@
     /// This allows
        /// for switches and enums and such, but be careful you don't set two
        /// strings with the same id, as this does not check for such 
occurrences.
-       /// Converts the strings to lower case if mSetToLower is true.
-       /// In any case, sets mSetToLower to false at the end.
        ///
        /// @param pList
        /// An array of svt objects, these should be fully constructed, 
including
@@ -123,12 +121,7 @@
        /// @param size
     /// Number of elements in the svt objects array
     ///
-       void insert_group(svt* pList, std::size_t size);
-
-       /// \brief
-       /// Call this just before calling insert_group if the next group should
-       /// be set to lower_case before addition.
-       void lower_next_group() { mSetToLower = true; }
+       void insert_group(const svt* pList, std::size_t size);
 
        /// Insert a string when you will handle the locking yourself.
     //
@@ -153,7 +146,6 @@
                mTable(),
                mLock(),
                mHighestKey(0),
-               mSetToLower(false),
                mCaseInsensitive(false)
        {/**/}
 
@@ -162,7 +154,6 @@
        static const std::string mEmpty; // The empty string, universally.
        boost::mutex mLock;
        std::size_t mHighestKey;
-       bool mSetToLower; // If true, affects the next group addition.
        bool mCaseInsensitive;
 };
 

=== modified file 'libcore/MovieClip.cpp'
--- a/libcore/MovieClip.cpp     2009-12-04 09:20:14 +0000
+++ b/libcore/MovieClip.cpp     2009-12-09 12:19:32 +0000
@@ -1608,10 +1608,9 @@
         event_id(event_id::DRAG_OUT),
     };
 
-    static const size_t size = sizeof(EH) / sizeof(EH[0]);
+    const size_t size = arraySize(EH);
 
-    for (size_t i = 0; i < size; ++i)
-    {
+    for (size_t i = 0; i < size; ++i) {
         const event_id &event = EH[i];
 
         // Check event handlers

=== modified file 'libcore/PropertyList.cpp'
--- a/libcore/PropertyList.cpp  2009-12-03 13:36:04 +0000
+++ b/libcore/PropertyList.cpp  2009-12-09 12:22:52 +0000
@@ -65,8 +65,7 @@
 PropertyList::getPropertyByOrder(int order)
 {
     order_iterator i = iterator_find(_props, order);
-       if (i == _props.get<1>().end())
-               return NULL;
+       if (i == _props.get<1>().end()) return 0;
 
        return &(*i);
 }
@@ -76,14 +75,11 @@
 {
     order_iterator i = iterator_find(_props, order);
 
-       if (i == _props.get<1>().end())
-               return NULL; // Not found at all.
+       if (i == _props.get<1>().end()) return 0;
 
-       do
-       {
+       do {
                ++i;
-               if (i == _props.get<1>().end())
-                       return NULL;
+               if (i == _props.get<1>().end()) return 0;
        } while (i->getFlags().get_dont_enum());
 
        return &(*i);

=== modified file 'libcore/SystemClock.cpp'
--- a/libcore/SystemClock.cpp   2009-02-25 22:33:03 +0000
+++ b/libcore/SystemClock.cpp   2009-12-09 13:49:55 +0000
@@ -27,32 +27,31 @@
 
 #include <boost/cstdint.hpp> // for boost::uint64_t typedef
 
-namespace gnash
-{
-
-/* static private */
+namespace gnash {
+
+namespace {
+
 boost::uint64_t
-SystemClock::fetchSystemTime() 
+fetchSystemTime() 
 {
-    // Time::getTicks always returns milliseconds
+    // ClockTime::getTicks always returns milliseconds
     return clocktime::getTicks();
 }
 
-/* public */
+}
+
 SystemClock::SystemClock() 
        :
        _startTime(fetchSystemTime())
 {
 }
 
-/* public */
 unsigned long int
 SystemClock::elapsed() const
 {
     return fetchSystemTime() - _startTime;
 }
 
-/* public */
 void
 SystemClock::restart()
 {

=== modified file 'libcore/SystemClock.h'
--- a/libcore/SystemClock.h     2009-02-25 22:33:03 +0000
+++ b/libcore/SystemClock.h     2009-12-09 13:49:55 +0000
@@ -47,9 +47,6 @@
 
 private:
 
-    /// Query system time and return it in milliseconds
-    static boost::uint64_t fetchSystemTime();
-
     /// System time at time of start
     boost::uint64_t _startTime;
 };

=== modified file 'libcore/abc/Class.h'
--- a/libcore/abc/Class.h       2009-12-08 11:59:39 +0000
+++ b/libcore/abc/Class.h       2009-12-09 09:46:05 +0000
@@ -62,22 +62,18 @@
 /// An abc::Class is a static description of an ActionScript Class. Classes
 /// have the following important properties:
 //
-/// 1.  A static initialization method ("cinit"). This is executed no more
-///     than once. 
+/// 1.  A static initialization method ("cinit"). This is executed during
+///     the opcode NewClass, which is generally called only once per class.
 /// 2.  A constructor method ("iinit"). This is run every time the Class
 ///     is constructed. As not all Classes are constructed, the iinit method
 ///     may never be executed.
+/// 3. A set of class Traits.
+/// 4. A set of instance Traits.
 //
 /// Classes are parsed from the "instances" and "classes" section of an
 /// ABCBlock. Each of these contains the same number of entries. The iinit
 /// methods are found in the instances section, the cinit methods in the
 /// classes section.
-//
-/// Note: the following does not describe very well how the data are organized
-/// in the ABC file.
-/// A Script may contain more than one class. When a Script runs, the cinit
-/// methods of all its classes are executed in the order they appear in the
-/// Script.
 class Class
 {
 public:
@@ -101,8 +97,6 @@
         _inherited(false),
                _system(false)
        {}
-
-       as_object* getPrototype() { return _prototype; }
        
     void setDeclared() { _declared = true; }
        bool isDeclared() { return _declared; }
@@ -186,13 +180,8 @@
        /// Set the protected namespace.
        void setProtectedNs(Namespace *n) { _protectedNs = n; }
 
+    /// The global name of the class.
        string_table::key getName() const { return _name; }
-
-    void setPrototype(as_object* prototype) {
-        _prototype = prototype;
-    }
-
-       void initPrototype();
        
     /// Retrieve the Class from which this Class derives.
     Class* getSuper() const { return _super; }
@@ -244,6 +233,17 @@
        Property* getSetBinding(as_value& v, abc::MultiName& n);
     std::vector<abc::Trait> _traits;
 
+    /// Necessary for the current bogus implementation.
+    void setPrototype(as_object* prototype) {
+        _prototype = prototype;
+    }
+
+    /// Necessary for the current bogus implementation.
+       void initPrototype();
+
+    /// Necessary for the current bogus implementation.
+       as_object* getPrototype() { return _prototype; }
+
 private:
        
        typedef std::map<string_table::key, Property> BindingContainer;

=== modified file 'libcore/asobj/flash/display/MovieClip_as.cpp'
--- a/libcore/asobj/flash/display/MovieClip_as.cpp      2009-12-07 12:16:50 
+0000
+++ b/libcore/asobj/flash/display/MovieClip_as.cpp      2009-12-10 11:58:42 
+0000
@@ -331,7 +331,7 @@
         )
     }
 
-    Movie* m = getRoot(fn).topLevelMovie();
+    Movie* m = ptr->get_root();
     as_object* o = getObjectWithPrototype(getGlobal(fn), 
NSV::CLASS_MOVIE_CLIP);
     MovieClip* mc = new MovieClip(o, 0, m, ptr);
 

=== modified file 'libcore/asobj/flash/system/System_as.cpp'
--- a/libcore/asobj/flash/system/System_as.cpp  2009-11-18 11:51:35 +0000
+++ b/libcore/asobj/flash/system/System_as.cpp  2009-12-09 11:51:54 +0000
@@ -26,6 +26,7 @@
 #include "builtin_function.h"
 #include "NativeFunction.h" 
 #include "VM.h" // for getPlayerVersion() 
+#include "GnashAlgorithm.h"
 
 #include <sstream>
 
@@ -486,9 +487,10 @@
                                "pl", "hu", "cs", "tr", "fi",
                                "da", "nl", "no", "ru"};
        
-       const unsigned int size = sizeof (languages) / sizeof (*languages);
+       const size_t size = arraySize(languages);
        
-       if (std::find(languages, languages + size, lang.substr(0,2)) != 
languages + size)
+       if (std::find(languages, languages + size, lang.substr(0, 2)) !=
+            languages + size)
        {
                if (lang.substr(0,2) == "zh")
                {

=== modified file 'libcore/namedStrings.cpp'
--- a/libcore/namedStrings.cpp  2009-12-02 12:30:12 +0000
+++ b/libcore/namedStrings.cpp  2009-12-09 12:19:39 +0000
@@ -24,239 +24,240 @@
 
 #include "namedStrings.h"
 #include "string_table.h"
+#include "GnashAlgorithm.h"
 
 namespace gnash {
 namespace NSV { // Named String Values
 
 // Load up our pre-known names
-static string_table::svt preload_names[] =
+static const string_table::svt preload_names[] =
 {
-       string_table::svt( "a", NSV::PROP_A ),
-       string_table::svt( "addListener", NSV::PROP_ADD_LISTENER ),
-       string_table::svt( "align", NSV::PROP_ALIGN ),
-       string_table::svt( "ASnative", NSV::PROP_AS_NATIVE ),
-       string_table::svt( "ASSetPropFlags", NSV::PROP_AS_SET_PROP_FLAGS ),
-       string_table::svt( "_alpha", NSV::PROP_uALPHA ),
-       string_table::svt( "b", NSV::PROP_B ),
-       string_table::svt( "blockIndent", NSV::PROP_BLOCK_INDENT ),
-       string_table::svt( "bold", NSV::PROP_BOLD ),
-       string_table::svt( "broadcastMessage", NSV::PROP_BROADCAST_MESSAGE ),
-       string_table::svt( "bullet", NSV::PROP_BULLET ),
-       string_table::svt( "_bytesTotal", NSV::PROP_uBYTES_TOTAL ),
-       string_table::svt( "_bytesLoaded", NSV::PROP_uBYTES_LOADED ),
-       string_table::svt( "c", NSV::PROP_C ),
-       string_table::svt( "callee", NSV::PROP_CALLEE ),
-       string_table::svt( "caller", NSV::PROP_CALLER ),
-       //string_table::svt( "color", NSV::PROP_COLOR ), // clashes with 
CLASS_COLOR in case-insensitive mode
-       string_table::svt( "concat", NSV::PROP_CONCAT ),        
-       string_table::svt( "constructor", NSV::PROP_CONSTRUCTOR ),
-       string_table::svt( "__constructor__", NSV::PROP_uuCONSTRUCTORuu ),
-       string_table::svt( "contentType", NSV::PROP_CONTENT_TYPE),
-       string_table::svt( "_currentframe", NSV::PROP_uCURRENTFRAME ),
-       string_table::svt( "_customHeaders", NSV::PROP_uCUSTOM_HEADERS ),
-       string_table::svt( "d", NSV::PROP_D ),
-       string_table::svt( "data", NSV::PROP_DATA ),
-       string_table::svt( "decode", NSV::PROP_DECODE ),
-       string_table::svt( "e", NSV::PROP_E ),  
-       string_table::svt( "escape", NSV::PROP_ESCAPE ),        
-       string_table::svt( "_droptarget", NSV::PROP_uDROPTARGET ),
-       string_table::svt( "enabled", NSV::PROP_ENABLED ),
-       string_table::svt( "useHandCursor", NSV::PROP_USEHANDCURSOR ),
-       string_table::svt( "focusEnabled", NSV::PROP_FOCUS_ENABLED ),   
-       string_table::svt( "_focusrect", NSV::PROP_uFOCUSRECT ),
-       string_table::svt( "_framesloaded", NSV::PROP_uFRAMESLOADED ),
-       string_table::svt( "_height", NSV::PROP_uHEIGHT ),
-        string_table::svt( "g", NSV::PROP_G ),
-        string_table::svt( "h", NSV::PROP_H ),
-       string_table::svt( "height", NSV::PROP_HEIGHT ),
-       string_table::svt( "_highquality", NSV::PROP_uHIGHQUALITY ),
-       string_table::svt( "_quality", NSV::PROP_uQUALITY ),
-       string_table::svt( "htmlText", NSV::PROP_HTML_TEXT ),
-       string_table::svt( "indent", NSV::PROP_INDENT ),
-       string_table::svt( "italic", NSV::PROP_ITALIC ),
-       string_table::svt( "leading", NSV::PROP_LEADING ),
-       string_table::svt( "left_margin", NSV::PROP_LEFT_MARGIN ),
-       string_table::svt( "length", NSV::PROP_LENGTH ),
-       string_table::svt( "_listeners", NSV::PROP_uLISTENERS ),
-       string_table::svt( "loaded", NSV::PROP_LOADED ),
-       string_table::svt( "matrixType", NSV::PROP_MATRIX_TYPE),
-       string_table::svt( "meth", NSV::PROP_METH),
-       string_table::svt( "_name", NSV::PROP_uNAME ),
-       string_table::svt( "onLoad", NSV::PROP_ON_LOAD ),
-       string_table::svt( "onClose", NSV::PROP_ON_CLOSE ),
-       string_table::svt( "onLoadStart", NSV::PROP_ON_LOAD_START ),
-       string_table::svt( "onLoadError", NSV::PROP_ON_LOAD_ERROR ),
-       string_table::svt( "onLoadProgress", NSV::PROP_ON_LOAD_PROGRESS ),
-       string_table::svt( "onLoadInit", NSV::PROP_ON_LOAD_INIT ),
-        string_table::svt( "onSoundComplete", NSV::PROP_ON_SOUND_COMPLETE ),
-       string_table::svt( "onUnload", NSV::PROP_ON_UNLOAD ),
-       string_table::svt( "onEnterFrame", NSV::PROP_ON_ENTER_FRAME ),
-       string_table::svt( "onConstruct", NSV::PROP_ON_CONSTRUCT ),
-       string_table::svt( "onInitialize", NSV::PROP_ON_INITIALIZE ),
-       string_table::svt( "onData", NSV::PROP_ON_DATA ),
-       string_table::svt( "onResize", NSV::PROP_ON_RESIZE ),
-       string_table::svt( "onFullScreen", NSV::PROP_ON_FULLSCREEN ),
-       string_table::svt( "onPress", NSV::PROP_ON_PRESS ),
-       string_table::svt( "onRelease", NSV::PROP_ON_RELEASE ),
-       string_table::svt( "onReleaseOutside", NSV::PROP_ON_RELEASE_OUTSIDE ),
-       string_table::svt( "onRollOut", NSV::PROP_ON_ROLL_OUT ),
-       string_table::svt( "onRollOver", NSV::PROP_ON_ROLL_OVER ),
-       string_table::svt( "onDragOver", NSV::PROP_ON_DRAG_OVER ),
-       string_table::svt( "onDragOut", NSV::PROP_ON_DRAG_OUT ),
-       string_table::svt( "onKeyPress", NSV::PROP_ON_KEY_PRESS ),
-       string_table::svt( "onKeyDown", NSV::PROP_ON_KEY_DOWN ),
-       string_table::svt( "onKeyUp", NSV::PROP_ON_KEY_UP ),
-       string_table::svt( "onMouseDown", NSV::PROP_ON_MOUSE_DOWN ),
-       string_table::svt( "onMouseUp", NSV::PROP_ON_MOUSE_UP ),
-       string_table::svt( "onMouseMove", NSV::PROP_ON_MOUSE_MOVE ),
-       string_table::svt( "onSetFocus", NSV::PROP_ON_SET_FOCUS ),
-       string_table::svt( "onKillFocus", NSV::PROP_ON_KILL_FOCUS ),
-       string_table::svt( "onSelect", NSV::PROP_ON_SELECT ),
-       string_table::svt( "onStatus", NSV::PROP_ON_STATUS ),
-       string_table::svt( "onResult", NSV::PROP_ON_RESULT ),
-       string_table::svt( "onMetaData", NSV::PROP_ON_META_DATA ),
-       string_table::svt( "onConnect", NSV::PROP_ON_CONNECT ),
+    string_table::svt( "a", NSV::PROP_A ),
+    string_table::svt( "addListener", NSV::PROP_ADD_LISTENER ),
+    string_table::svt( "align", NSV::PROP_ALIGN ),
+    string_table::svt( "ASnative", NSV::PROP_AS_NATIVE ),
+    string_table::svt( "ASSetPropFlags", NSV::PROP_AS_SET_PROP_FLAGS ),
+    string_table::svt( "_alpha", NSV::PROP_uALPHA ),
+    string_table::svt( "b", NSV::PROP_B ),
+    string_table::svt( "blockIndent", NSV::PROP_BLOCK_INDENT ),
+    string_table::svt( "bold", NSV::PROP_BOLD ),
+    string_table::svt( "broadcastMessage", NSV::PROP_BROADCAST_MESSAGE ),
+    string_table::svt( "bullet", NSV::PROP_BULLET ),
+    string_table::svt( "_bytesTotal", NSV::PROP_uBYTES_TOTAL ),
+    string_table::svt( "_bytesLoaded", NSV::PROP_uBYTES_LOADED ),
+    string_table::svt( "c", NSV::PROP_C ),
+    string_table::svt( "callee", NSV::PROP_CALLEE ),
+    string_table::svt( "caller", NSV::PROP_CALLER ),
+    //string_table::svt( "color", NSV::PROP_COLOR ), // clashes with 
CLASS_COLOR in case-insensitive mode
+    string_table::svt( "concat", NSV::PROP_CONCAT ),    
+    string_table::svt( "constructor", NSV::PROP_CONSTRUCTOR ),
+    string_table::svt( "__constructor__", NSV::PROP_uuCONSTRUCTORuu ),
+    string_table::svt( "contentType", NSV::PROP_CONTENT_TYPE),
+    string_table::svt( "_currentframe", NSV::PROP_uCURRENTFRAME ),
+    string_table::svt( "_customHeaders", NSV::PROP_uCUSTOM_HEADERS ),
+    string_table::svt( "d", NSV::PROP_D ),
+    string_table::svt( "data", NSV::PROP_DATA ),
+    string_table::svt( "decode", NSV::PROP_DECODE ),
+    string_table::svt( "e", NSV::PROP_E ),    
+    string_table::svt( "escape", NSV::PROP_ESCAPE ),    
+    string_table::svt( "_droptarget", NSV::PROP_uDROPTARGET ),
+    string_table::svt( "enabled", NSV::PROP_ENABLED ),
+    string_table::svt( "useHandCursor", NSV::PROP_USEHANDCURSOR ),
+    string_table::svt( "focusEnabled", NSV::PROP_FOCUS_ENABLED ),    
+    string_table::svt( "_focusrect", NSV::PROP_uFOCUSRECT ),
+    string_table::svt( "_framesloaded", NSV::PROP_uFRAMESLOADED ),
+    string_table::svt( "_height", NSV::PROP_uHEIGHT ),
+    string_table::svt( "g", NSV::PROP_G ),
+    string_table::svt( "h", NSV::PROP_H ),
+    string_table::svt( "height", NSV::PROP_HEIGHT ),
+    string_table::svt( "_highquality", NSV::PROP_uHIGHQUALITY ),
+    string_table::svt( "_quality", NSV::PROP_uQUALITY ),
+    string_table::svt( "htmlText", NSV::PROP_HTML_TEXT ),
+    string_table::svt( "indent", NSV::PROP_INDENT ),
+    string_table::svt( "italic", NSV::PROP_ITALIC ),
+    string_table::svt( "leading", NSV::PROP_LEADING ),
+    string_table::svt( "left_margin", NSV::PROP_LEFT_MARGIN ),
+    string_table::svt( "length", NSV::PROP_LENGTH ),
+    string_table::svt( "_listeners", NSV::PROP_uLISTENERS ),
+    string_table::svt( "loaded", NSV::PROP_LOADED ),
+    string_table::svt( "matrixType", NSV::PROP_MATRIX_TYPE),
+    string_table::svt( "meth", NSV::PROP_METH),
+    string_table::svt( "_name", NSV::PROP_uNAME ),
+    string_table::svt( "onLoad", NSV::PROP_ON_LOAD ),
+    string_table::svt( "onClose", NSV::PROP_ON_CLOSE ),
+    string_table::svt( "onLoadStart", NSV::PROP_ON_LOAD_START ),
+    string_table::svt( "onLoadError", NSV::PROP_ON_LOAD_ERROR ),
+    string_table::svt( "onLoadProgress", NSV::PROP_ON_LOAD_PROGRESS ),
+    string_table::svt( "onLoadInit", NSV::PROP_ON_LOAD_INIT ),
+    string_table::svt( "onSoundComplete", NSV::PROP_ON_SOUND_COMPLETE ),
+    string_table::svt( "onUnload", NSV::PROP_ON_UNLOAD ),
+    string_table::svt( "onEnterFrame", NSV::PROP_ON_ENTER_FRAME ),
+    string_table::svt( "onConstruct", NSV::PROP_ON_CONSTRUCT ),
+    string_table::svt( "onInitialize", NSV::PROP_ON_INITIALIZE ),
+    string_table::svt( "onData", NSV::PROP_ON_DATA ),
+    string_table::svt( "onResize", NSV::PROP_ON_RESIZE ),
+    string_table::svt( "onFullScreen", NSV::PROP_ON_FULLSCREEN ),
+    string_table::svt( "onPress", NSV::PROP_ON_PRESS ),
+    string_table::svt( "onRelease", NSV::PROP_ON_RELEASE ),
+    string_table::svt( "onReleaseOutside", NSV::PROP_ON_RELEASE_OUTSIDE ),
+    string_table::svt( "onRollOut", NSV::PROP_ON_ROLL_OUT ),
+    string_table::svt( "onRollOver", NSV::PROP_ON_ROLL_OVER ),
+    string_table::svt( "onDragOver", NSV::PROP_ON_DRAG_OVER ),
+    string_table::svt( "onDragOut", NSV::PROP_ON_DRAG_OUT ),
+    string_table::svt( "onKeyPress", NSV::PROP_ON_KEY_PRESS ),
+    string_table::svt( "onKeyDown", NSV::PROP_ON_KEY_DOWN ),
+    string_table::svt( "onKeyUp", NSV::PROP_ON_KEY_UP ),
+    string_table::svt( "onMouseDown", NSV::PROP_ON_MOUSE_DOWN ),
+    string_table::svt( "onMouseUp", NSV::PROP_ON_MOUSE_UP ),
+    string_table::svt( "onMouseMove", NSV::PROP_ON_MOUSE_MOVE ),
+    string_table::svt( "onSetFocus", NSV::PROP_ON_SET_FOCUS ),
+    string_table::svt( "onKillFocus", NSV::PROP_ON_KILL_FOCUS ),
+    string_table::svt( "onSelect", NSV::PROP_ON_SELECT ),
+    string_table::svt( "onStatus", NSV::PROP_ON_STATUS ),
+    string_table::svt( "onResult", NSV::PROP_ON_RESULT ),
+    string_table::svt( "onMetaData", NSV::PROP_ON_META_DATA ),
+    string_table::svt( "onConnect", NSV::PROP_ON_CONNECT ),
     string_table::svt( "onXML", NSV::PROP_ON_XML ),
-       string_table::svt( "parseXML", NSV::PROP_PARSE_XML ),
-       string_table::svt( "onTimer", NSV::PROP_ON_TIMER ),
-       string_table::svt( "_parent", NSV::PROP_uPARENT ),
-       string_table::svt( "_root", NSV::PROP_uROOT ),
-       string_table::svt( "_global", NSV::PROP_uGLOBAL ),
-       string_table::svt( "__proto__", NSV::PROP_uuPROTOuu ),
-       string_table::svt( "prototype", NSV::PROP_PROTOTYPE ),
-       string_table::svt( "push", NSV::PROP_PUSH ),
-       string_table::svt( "__resolve", NSV::PROP_uuRESOLVE ),
-       string_table::svt( "r", NSV::PROP_R ),
-       string_table::svt( "removeListener", NSV::PROP_REMOVE_LISTENER ),
-       string_table::svt( "rightMargin", NSV::PROP_RIGHT_MARGIN ),
-       string_table::svt( "_rotation", NSV::PROP_uROTATION ),
-       string_table::svt( "scaleMode", NSV::PROP_SCALE_MODE ),
-       string_table::svt( "size", NSV::PROP_SIZE ),
-       string_table::svt( "_soundbuftime", NSV::PROP_uSOUNDBUFTIME ),
-       string_table::svt( "splice", NSV::PROP_SPLICE ),
-       string_table::svt( "Stage", NSV::PROP_iSTAGE ),
-       string_table::svt( "status", NSV::PROP_STATUS ),
-       string_table::svt( "super", NSV::PROP_SUPER ),
-       string_table::svt( "target", NSV::PROP_TARGET ),
-       string_table::svt( "_target", NSV::PROP_uTARGET ),
-       string_table::svt( "text", NSV::PROP_TEXT ),
-       string_table::svt( "textColor", NSV::PROP_TEXT_COLOR ),
-       string_table::svt( "textWidth", NSV::PROP_TEXT_WIDTH ),
-       string_table::svt( "textHeight", NSV::PROP_TEXT_HEIGHT ),
-       string_table::svt( "toString", NSV::PROP_TO_STRING ),
-       string_table::svt( "toLowerCase", NSV::PROP_TO_LOWER_CASE ),
-       string_table::svt( "_totalframes", NSV::PROP_uTOTALFRAMES ),
-       string_table::svt( "tx", NSV::PROP_TX ),
-       string_table::svt( "ty", NSV::PROP_TY ),
-       string_table::svt( "underline", NSV::PROP_UNDERLINE ),
-       string_table::svt( "_url", NSV::PROP_uURL ),
-       string_table::svt( "valueOf", NSV::PROP_VALUE_OF ),
-       string_table::svt( "_visible", NSV::PROP_uVISIBLE ),
-       string_table::svt( "w", NSV::PROP_W ),
-       string_table::svt( "_width", NSV::PROP_uWIDTH ),
-       string_table::svt( "width", NSV::PROP_WIDTH ),
-       string_table::svt( "x", NSV::PROP_X ),
-       string_table::svt( "_x", NSV::PROP_uX ),
-       string_table::svt( "_xmouse", NSV::PROP_uXMOUSE ),
-       string_table::svt( "_xscale", NSV::PROP_uXSCALE ),
-       string_table::svt( "y", NSV::PROP_Y ),
-       string_table::svt( "_y", NSV::PROP_uY ),
-       string_table::svt( "_ymouse", NSV::PROP_uYMOUSE ),
-       string_table::svt( "_yscale", NSV::PROP_uYSCALE ),
-       string_table::svt( "System", NSV::CLASS_SYSTEM ),
-       string_table::svt( "AntiAliasType", NSV::CLASS_ANTIALIASTYPE ),
-       string_table::svt( "CSMTextSettings", NSV::CLASS_CSMTEXTSETTINGS ),
-       string_table::svt( "Font", NSV::CLASS_FONT),
-       string_table::svt( "FontStyle", NSV::CLASS_FONTSTYLE),
-       string_table::svt( "GridFitType", NSV::CLASS_GRIDFITTYPE),
-       string_table::svt( "StaticText", NSV::CLASS_STATICTEXT),
-       string_table::svt( "StyleSheet", NSV::CLASS_STYLESHEET),
-       string_table::svt( "TextColorType", NSV::CLASS_TEXTCOLORTYPE),
-       string_table::svt( "TextDisplayMode", NSV::CLASS_TEXTDISPLAYMODE),
-       string_table::svt( "TextFieldType", NSV::CLASS_TEXTFIELDTYPE),
-       string_table::svt( "TextFormatAlign", NSV::CLASS_TEXTFORMATALIGN),
-       string_table::svt( "TextLineMetrics", NSV::CLASS_TEXTLINEMETRICS),
-       string_table::svt( "TextRenderer", NSV::CLASS_TEXTRENDERER),
-//     string_table::svt( "Stage", NSV::CLASS_STAGE ), // Identical to 
PROP_iSTAGE
-       string_table::svt( "MovieClip", NSV::CLASS_MOVIE_CLIP ),
-       string_table::svt( "TextField", NSV::CLASS_TEXT_FIELD ),
-       string_table::svt( "Button", NSV::CLASS_BUTTON ),
-       string_table::svt( "Math", NSV::CLASS_MATH ),
-       string_table::svt( "Boolean", NSV::CLASS_BOOLEAN ),
-       string_table::svt( "Bitmap", NSV::CLASS_BITMAP ),
-       string_table::svt( "Color", NSV::CLASS_COLOR ),
-       string_table::svt( "Selection", NSV::CLASS_SELECTION ),
-       string_table::svt( "Sound", NSV::CLASS_SOUND ),
-       string_table::svt( "SimpleButton", NSV::CLASS_SIMPLE_BUTTON ),
-       string_table::svt( "XMLSocket", NSV::CLASS_XMLSOCKET ),
-       string_table::svt( "Shape", NSV::CLASS_SHAPE ),
-       string_table::svt( "Date", NSV::CLASS_DATE ),
-       string_table::svt( "XML", NSV::CLASS_XML ),
-       string_table::svt( "XMLDocument", NSV::CLASS_XML_DOCUMENT ),
-       string_table::svt( "XMLNode", NSV::CLASS_XMLNODE ),
-       string_table::svt( "Mouse", NSV::CLASS_MOUSE ),
-       string_table::svt( "Object", NSV::CLASS_OBJECT ),
-       string_table::svt( "String", NSV::CLASS_STRING ),
-       string_table::svt( "Number", NSV::CLASS_NUMBER ),
-       string_table::svt( "Accessibility", NSV::CLASS_ACCESSIBILITY ), 
-       string_table::svt( "Array", NSV::CLASS_ARRAY ),
-       string_table::svt( "Key", NSV::CLASS_KEY ),
-       string_table::svt( "Keyboard", NSV::CLASS_KEYBOARD ),
-       string_table::svt( "AsBroadcaster", NSV::CLASS_AS_BROADCASTER ),
-       string_table::svt( "Function", NSV::CLASS_FUNCTION ),
-       string_table::svt( "TextSnapshot", NSV::CLASS_TEXT_SNAPSHOT ),
-       string_table::svt( "TextFormat", NSV::CLASS_TEXT_FORMAT ),
-       string_table::svt( "Video", NSV::CLASS_VIDEO ),
-       string_table::svt( "Camera", NSV::CLASS_CAMERA ),
-       string_table::svt( "Microphone", NSV::CLASS_MICROPHONE ),
-       string_table::svt( "SharedObject", NSV::CLASS_SHARED_OBJECT ),
-       string_table::svt( "LoadVars", NSV::CLASS_LOAD_VARS ),
-       string_table::svt( "LocalConnection", NSV::CLASS_LOCALCONNECTION ),
-       string_table::svt( "CustomActions", NSV::CLASS_CUSTOM_ACTIONS ),
-       string_table::svt( "QName", NSV::CLASS_QNAME ),
-       string_table::svt( "Namespace", NSV::CLASS_NAMESPACE ),
-       string_table::svt( "NetConnection", NSV::CLASS_NET_CONNECTION ),
-       string_table::svt( "NetStream", NSV::CLASS_NET_STREAM ),
-       string_table::svt( "ContextMenu", NSV::CLASS_CONTEXTMENU ),
-       string_table::svt( "ContextMenuItem", NSV::CLASS_CONTEXTMENUITEM ),
-       string_table::svt( "MovieClipLoader", NSV::CLASS_MOVIE_CLIP_LOADER ),
-       string_table::svt( "Error", NSV::CLASS_ERROR ),
-       string_table::svt( "Event", NSV::CLASS_EVENT),
-       string_table::svt( "EventDispatcher", NSV::CLASS_EVENTDISPATCHER),
-       string_table::svt( "DisplayObject", NSV::CLASS_DISPLAYOBJECT),
-       string_table::svt( "InteractiveObject", NSV::CLASS_INTERACTIVEOBJECT ),
-       string_table::svt( "DisplayObjectContainer", 
NSV::CLASS_DISPLAYOBJECTCONTAINER ),
-       string_table::svt( "Sprite", NSV::CLASS_SPRITE ),
-       string_table::svt( "int", NSV::CLASS_INT ),
-       string_table::svt( "TextFieldAutoSize", NSV::CLASS_TEXTFIELDAUTOSIZE),
-       string_table::svt( "onSync", NSV::PROP_ON_SYNC ),
-       string_table::svt( "flash.display", NSV::NS_FLASH_DISPLAY ),
-       string_table::svt( "flash.text", NSV::NS_FLASH_TEXT ),
-       string_table::svt( "flash.geom", NSV::NS_FLASH_GEOM ),
-       string_table::svt( "flash.net", NSV::NS_FLASH_NET ),
-       string_table::svt( "flash.system", NSV::NS_FLASH_SYSTEM ),
-       string_table::svt( "flash.utils", NSV::NS_FLASH_UTILS ),
-       string_table::svt( "flash.events", NSV::NS_FLASH_EVENTS ),
-       string_table::svt( "flash.errors", NSV::NS_FLASH_ERRORS ),
-       string_table::svt( "flash.accessibility", NSV::NS_FLASH_ACCESSIBILITY ),
-       string_table::svt( "flash.media", NSV::NS_FLASH_MEDIA ),
-       string_table::svt( "flash.xml", NSV::NS_FLASH_XML ),
-       string_table::svt( "flash.ui", NSV::NS_FLASH_UI ),
-       string_table::svt( "adobe.utils", NSV::NS_ADOBE_UTILS ),
-       string_table::svt( "", NSV::INTERNAL_TYPE ),
-       string_table::svt( "", NSV::INTERNAL_STACK_PARENT ),
-       string_table::svt( "", NSV::INTERNAL_INTERFACES )
+    string_table::svt( "parseXML", NSV::PROP_PARSE_XML ),
+    string_table::svt( "onTimer", NSV::PROP_ON_TIMER ),
+    string_table::svt( "_parent", NSV::PROP_uPARENT ),
+    string_table::svt( "_root", NSV::PROP_uROOT ),
+    string_table::svt( "_global", NSV::PROP_uGLOBAL ),
+    string_table::svt( "__proto__", NSV::PROP_uuPROTOuu ),
+    string_table::svt( "prototype", NSV::PROP_PROTOTYPE ),
+    string_table::svt( "push", NSV::PROP_PUSH ),
+    string_table::svt( "__resolve", NSV::PROP_uuRESOLVE ),
+    string_table::svt( "r", NSV::PROP_R ),
+    string_table::svt( "removeListener", NSV::PROP_REMOVE_LISTENER ),
+    string_table::svt( "rightMargin", NSV::PROP_RIGHT_MARGIN ),
+    string_table::svt( "_rotation", NSV::PROP_uROTATION ),
+    string_table::svt( "scaleMode", NSV::PROP_SCALE_MODE ),
+    string_table::svt( "size", NSV::PROP_SIZE ),
+    string_table::svt( "_soundbuftime", NSV::PROP_uSOUNDBUFTIME ),
+    string_table::svt( "splice", NSV::PROP_SPLICE ),
+    string_table::svt( "Stage", NSV::PROP_iSTAGE ),
+    string_table::svt( "status", NSV::PROP_STATUS ),
+    string_table::svt( "super", NSV::PROP_SUPER ),
+    string_table::svt( "target", NSV::PROP_TARGET ),
+    string_table::svt( "_target", NSV::PROP_uTARGET ),
+    string_table::svt( "text", NSV::PROP_TEXT ),
+    string_table::svt( "textColor", NSV::PROP_TEXT_COLOR ),
+    string_table::svt( "textWidth", NSV::PROP_TEXT_WIDTH ),
+    string_table::svt( "textHeight", NSV::PROP_TEXT_HEIGHT ),
+    string_table::svt( "toString", NSV::PROP_TO_STRING ),
+    string_table::svt( "toLowerCase", NSV::PROP_TO_LOWER_CASE ),
+    string_table::svt( "_totalframes", NSV::PROP_uTOTALFRAMES ),
+    string_table::svt( "tx", NSV::PROP_TX ),
+    string_table::svt( "ty", NSV::PROP_TY ),
+    string_table::svt( "underline", NSV::PROP_UNDERLINE ),
+    string_table::svt( "_url", NSV::PROP_uURL ),
+    string_table::svt( "valueOf", NSV::PROP_VALUE_OF ),
+    string_table::svt( "_visible", NSV::PROP_uVISIBLE ),
+    string_table::svt( "w", NSV::PROP_W ),
+    string_table::svt( "_width", NSV::PROP_uWIDTH ),
+    string_table::svt( "width", NSV::PROP_WIDTH ),
+    string_table::svt( "x", NSV::PROP_X ),
+    string_table::svt( "_x", NSV::PROP_uX ),
+    string_table::svt( "_xmouse", NSV::PROP_uXMOUSE ),
+    string_table::svt( "_xscale", NSV::PROP_uXSCALE ),
+    string_table::svt( "y", NSV::PROP_Y ),
+    string_table::svt( "_y", NSV::PROP_uY ),
+    string_table::svt( "_ymouse", NSV::PROP_uYMOUSE ),
+    string_table::svt( "_yscale", NSV::PROP_uYSCALE ),
+    string_table::svt( "System", NSV::CLASS_SYSTEM ),
+    string_table::svt( "AntiAliasType", NSV::CLASS_ANTIALIASTYPE ),
+    string_table::svt( "CSMTextSettings", NSV::CLASS_CSMTEXTSETTINGS ),
+    string_table::svt( "Font", NSV::CLASS_FONT),
+    string_table::svt( "FontStyle", NSV::CLASS_FONTSTYLE),
+    string_table::svt( "GridFitType", NSV::CLASS_GRIDFITTYPE),
+    string_table::svt( "StaticText", NSV::CLASS_STATICTEXT),
+    string_table::svt( "StyleSheet", NSV::CLASS_STYLESHEET),
+    string_table::svt( "TextColorType", NSV::CLASS_TEXTCOLORTYPE),
+    string_table::svt( "TextDisplayMode", NSV::CLASS_TEXTDISPLAYMODE),
+    string_table::svt( "TextFieldType", NSV::CLASS_TEXTFIELDTYPE),
+    string_table::svt( "TextFormatAlign", NSV::CLASS_TEXTFORMATALIGN),
+    string_table::svt( "TextLineMetrics", NSV::CLASS_TEXTLINEMETRICS),
+    string_table::svt( "TextRenderer", NSV::CLASS_TEXTRENDERER),
+//  string_table::svt( "Stage", NSV::CLASS_STAGE ), // Identical to PROP_iSTAGE
+    string_table::svt( "MovieClip", NSV::CLASS_MOVIE_CLIP ),
+    string_table::svt( "TextField", NSV::CLASS_TEXT_FIELD ),
+    string_table::svt( "Button", NSV::CLASS_BUTTON ),
+    string_table::svt( "Math", NSV::CLASS_MATH ),
+    string_table::svt( "Boolean", NSV::CLASS_BOOLEAN ),
+    string_table::svt( "Bitmap", NSV::CLASS_BITMAP ),
+    string_table::svt( "Color", NSV::CLASS_COLOR ),
+    string_table::svt( "Selection", NSV::CLASS_SELECTION ),
+    string_table::svt( "Sound", NSV::CLASS_SOUND ),
+    string_table::svt( "SimpleButton", NSV::CLASS_SIMPLE_BUTTON ),
+    string_table::svt( "XMLSocket", NSV::CLASS_XMLSOCKET ),
+    string_table::svt( "Shape", NSV::CLASS_SHAPE ),
+    string_table::svt( "Date", NSV::CLASS_DATE ),
+    string_table::svt( "XML", NSV::CLASS_XML ),
+    string_table::svt( "XMLDocument", NSV::CLASS_XML_DOCUMENT ),
+    string_table::svt( "XMLNode", NSV::CLASS_XMLNODE ),
+    string_table::svt( "Mouse", NSV::CLASS_MOUSE ),
+    string_table::svt( "Object", NSV::CLASS_OBJECT ),
+    string_table::svt( "String", NSV::CLASS_STRING ),
+    string_table::svt( "Number", NSV::CLASS_NUMBER ),
+    string_table::svt( "Accessibility", NSV::CLASS_ACCESSIBILITY ),    
+    string_table::svt( "Array", NSV::CLASS_ARRAY ),
+    string_table::svt( "Key", NSV::CLASS_KEY ),
+    string_table::svt( "Keyboard", NSV::CLASS_KEYBOARD ),
+    string_table::svt( "AsBroadcaster", NSV::CLASS_AS_BROADCASTER ),
+    string_table::svt( "Function", NSV::CLASS_FUNCTION ),
+    string_table::svt( "TextSnapshot", NSV::CLASS_TEXT_SNAPSHOT ),
+    string_table::svt( "TextFormat", NSV::CLASS_TEXT_FORMAT ),
+    string_table::svt( "Video", NSV::CLASS_VIDEO ),
+    string_table::svt( "Camera", NSV::CLASS_CAMERA ),
+    string_table::svt( "Microphone", NSV::CLASS_MICROPHONE ),
+    string_table::svt( "SharedObject", NSV::CLASS_SHARED_OBJECT ),
+    string_table::svt( "LoadVars", NSV::CLASS_LOAD_VARS ),
+    string_table::svt( "LocalConnection", NSV::CLASS_LOCALCONNECTION ),
+    string_table::svt( "CustomActions", NSV::CLASS_CUSTOM_ACTIONS ),
+    string_table::svt( "QName", NSV::CLASS_QNAME ),
+    string_table::svt( "Namespace", NSV::CLASS_NAMESPACE ),
+    string_table::svt( "NetConnection", NSV::CLASS_NET_CONNECTION ),
+    string_table::svt( "NetStream", NSV::CLASS_NET_STREAM ),
+    string_table::svt( "ContextMenu", NSV::CLASS_CONTEXTMENU ),
+    string_table::svt( "ContextMenuItem", NSV::CLASS_CONTEXTMENUITEM ),
+    string_table::svt( "MovieClipLoader", NSV::CLASS_MOVIE_CLIP_LOADER ),
+    string_table::svt( "Error", NSV::CLASS_ERROR ),
+    string_table::svt( "Event", NSV::CLASS_EVENT),
+    string_table::svt( "EventDispatcher", NSV::CLASS_EVENTDISPATCHER),
+    string_table::svt( "DisplayObject", NSV::CLASS_DISPLAYOBJECT),
+    string_table::svt( "InteractiveObject", NSV::CLASS_INTERACTIVEOBJECT ),
+    string_table::svt( "DisplayObjectContainer",
+            NSV::CLASS_DISPLAYOBJECTCONTAINER ),
+    string_table::svt( "Sprite", NSV::CLASS_SPRITE ),
+    string_table::svt( "int", NSV::CLASS_INT ),
+    string_table::svt( "TextFieldAutoSize", NSV::CLASS_TEXTFIELDAUTOSIZE),
+    string_table::svt( "onSync", NSV::PROP_ON_SYNC ),
+    string_table::svt( "flash.display", NSV::NS_FLASH_DISPLAY ),
+    string_table::svt( "flash.text", NSV::NS_FLASH_TEXT ),
+    string_table::svt( "flash.geom", NSV::NS_FLASH_GEOM ),
+    string_table::svt( "flash.net", NSV::NS_FLASH_NET ),
+    string_table::svt( "flash.system", NSV::NS_FLASH_SYSTEM ),
+    string_table::svt( "flash.utils", NSV::NS_FLASH_UTILS ),
+    string_table::svt( "flash.events", NSV::NS_FLASH_EVENTS ),
+    string_table::svt( "flash.errors", NSV::NS_FLASH_ERRORS ),
+    string_table::svt( "flash.accessibility", NSV::NS_FLASH_ACCESSIBILITY ),
+    string_table::svt( "flash.media", NSV::NS_FLASH_MEDIA ),
+    string_table::svt( "flash.xml", NSV::NS_FLASH_XML ),
+    string_table::svt( "flash.ui", NSV::NS_FLASH_UI ),
+    string_table::svt( "adobe.utils", NSV::NS_ADOBE_UTILS ),
+    string_table::svt( "", NSV::INTERNAL_TYPE ),
+    string_table::svt( "", NSV::INTERNAL_STACK_PARENT ),
+    string_table::svt( "", NSV::INTERNAL_INTERFACES )
 };
 
-void loadStrings(string_table &table, int version)
+void
+loadStrings(string_table& table, int version)
 {
-       if (version < 7)
-       {
-               table.set_insensitive();
-       }
+    if (version < 7) {
+        table.set_insensitive();
+    }
 
-       table.insert_group(preload_names,
-               sizeof (preload_names) / sizeof (string_table::svt));
+    table.insert_group(preload_names, arraySize(preload_names));
 }
 
 } // namespace NSV

=== modified file 'libcore/swf/DefineFontAlignZonesTag.cpp'
--- a/libcore/swf/DefineFontAlignZonesTag.cpp   2009-07-21 16:24:10 +0000
+++ b/libcore/swf/DefineFontAlignZonesTag.cpp   2009-12-09 11:59:12 +0000
@@ -43,10 +43,11 @@
        assert(tag == SWF::DEFINEALIGNZONES);
 
        in.ensureBytes(2);
-       unsigned short ref = in.read_u16(); // must reference a valid 
DEFINEFONT3 tag
+
+    // must reference a valid DEFINEFONT3 tag
+    const boost::uint16_t ref = in.read_u16(); 
        Font* referencedFont = m.get_font(ref);
-       if ( ! referencedFont )
-       {
+       if (!referencedFont) {
                IF_VERBOSE_MALFORMED_SWF(
                log_swferror(_("DefineFontAlignZones tag references an 
undefined "
                "font %d"), ref);
@@ -56,148 +57,41 @@
        }
 
        in.ensureBytes(1);
-       unsigned flags = in.read_u8(); // 2bits are cms table, 6bits are 
reserved
+    // 2bits are cms table, 6bits are reserved
+       const boost::uint8_t flags = in.read_u8();
 
        // TODO:
-       //      - parse swf_zone_array
-       //      - construct a DefineFontAlignZonesTag class
-       //      - register the tag with the referencedFont
-
+    // The first thing to to is test what this does. According to some
+    // sources, the tag is ignored and merely turns on the player's
+    // font engine.
        IF_VERBOSE_PARSE (
-       log_parse(_(" ** DefineFontAlignZones: font=%d, flags=%d"), ref, flags);
+        log_parse(_(" ** DefineFontAlignZones: font=%d, flags=%d"), ref, 
flags);
        );
 
-//     Si added here   
-//      The following codes are based on Alexis' SWF Reference.
-//     They are not guaranteed to be correct and completed.
-       unsigned short csm_table_int_temp=flags>>6;
-                       
-       assert(csm_table_int_temp == 0 || csm_table_int_temp == 1 || 
csm_table_int_temp == 2  );
-
-//     log_debug(_("The value of the 'tag': %d "),tag);        // You will get 
73 here!!  :)   
-//     log_debug(_("The value of the 'ref': %d "), ref); 
-//     log_debug(_("The value of the 'flags' : %d "),flags);            
-//     log_debug(_("The value of the 'csm_table_int_temp': %d 
"),csm_table_int_temp);  
-//     log_debug(_("The value of the 'font3.f_font2_glyphs_count: %d 
"),referencedFont->glyphCount() );
-
-//     log_debug(_("The value of the sizeof 'tag': %d \n"),sizeof(tag));       
//4
-//     log_debug(_("The value of the sizeof 'ref': %d \n"), sizeof(ref));      
//2
-//     log_debug(_("The value of the sizeof 'flags' : %d \n"),sizeof(flags)); 
//4               
-//     log_debug(_("The value of the sizeof 'csm_table_int_temp': %d  
\n"),sizeof(csm_table_int_temp));         //2
-
-//     log_debug(_("sizeof(int): %d \n"), sizeof(int) );    //4
-//     log_debug(_("sizeof(int): %d \n" ), sizeof(short int) );        //2
-//     log_debug(_("sizeof(unsigned short): %d \n"),sizeof(unsigned short) );  
//2
-//     log_debug(_("sizeof(unsigned): %d \n"), sizeof(unsigned) ); //4
-//      log_debug(_( "sizeof(float): %d \n"),sizeof(float) ); //4
-//      log_debug(_("sizeof(double): %d \n"), sizeof(double) );//8
-//      log_debug(_("sizeof(char): %d \n"), sizeof(char) );//1
-//     log_debug(_("****The value of the 'csm_table_int_temp': %d  
\n"),csm_table_int_temp);   
-//     log_debug(_("Hello, Let us try to parse all the tag information \n") );
-
-       Font::GlyphInfoRecords::size_type 
glyphs_count_temp=referencedFont->glyphCount();
-
-//     Let us have a loop to read all the information
-
-       for (int i=0; i!=int(glyphs_count_temp); i++){
-                       in.ensureBytes(1);
-                       unsigned int nouse;
-                       nouse=in.read_u8();             
-//                     log_debug(_("The value of f_zone_count= %d  \n"),nouse 
);
-                       
-                       for (int j=0; j!=2; j++){
-                               in.ensureBytes(2);
-                               float           
f_zone_position_temp=in.read_u16();
-                               in.ensureBytes(2);
-                               float           f_zone_size_temp=in.read_u16();
-//                             log_debug(_("   In the subloop:  glyph: %d 
zone= %d position= %f size= %f \n"),i+1,j+1,f_zone_position_temp, 
f_zone_size_temp );
-                               }               
-                       in.ensureBytes(1);
-                       nouse=in.read_u8();
-//                     log_debug(_("new output: glyph: %d, nouse =%d  
\n"),i+1,nouse );
-                       unsigned f_zone_x_temp=nouse & 0x0001;
-                       nouse = (nouse >> 1);
-                       unsigned f_zone_y_temp=nouse & 0x0001;
-                       
-//                     log_debug(_("new output: glyph: %d, f_zone_y= %d, 
f_zone_x=%d  \n"),i+1,f_zone_y_temp,f_zone_x_temp );
-                       }
-               
-               
-
-//     struct swf_definefontalignzones {
-//             swf_tag                 f_tag;          /* 73 */
-//             unsigned short          f_font2_id_ref;                 // 1 
bytes
-//             unsigned                f_csm_table_hint : 2;           //Read 
in flag? 2bits
-//             unsigned                f_reserved : 6;                 //Read 
in flag? 6bits
-//             swf_zone_array          f_zones[corresponding define 
font3.f_font2_glyphs_count];
-//     }
-
-       //ref readed
-       //tag readed 
-
-
-       // The f_font2_glyphs_count does not exist at all.
-       // I use the function glyphCount() defined in the Font class.
-       // This function retrieve the number of embedded glyphs in this font.
-
-       
-
-       //Now read for swf_zone_array.
-       ///But how?
-
-//     swf_zone_array f_zones_temp[2];
-       
-//     swf_zone_array f_zones_temp[glyphs_count_tempt];
-
-//     unsigned f_zone_count = in.read_u2(); // 2bits are cms table, 6bits are 
reserved
-//     for (int i=1; i<=f_zone_count; i++)
-//                     {
-//                     }
-       
-//     in.ensureBytes(1);
-
-               
-/*
-               struct swf_zone_array {
-                       unsigned char           f_zone_count;           // 
always 2 in V8.0           //??Why
-                       swf_zone_data           f_zone_data[f_zone_count];
-                       // I inverted the bits below, but I'm not too sure what 
is correct, do you know? 
-                       unsigned                f_reserved : 6;
-                       unsigned                f_zone_y : 1;           // 
probably always 1 in V8.0 
-                       unsigned                f_zone_x : 1;           // 
probably always 1 in V8.0 
-               };
-               
-               //What is the size here? char?
-               in.ensureBytes(1);
-               unsigned char uchar = in.read_u8();
-
-                       struct swf_zone_data {
-                               short float             f_zone_position;
-                               short float             f_zone_size;
-                       };
-                       in.ensureBytes(2);
-                       short float f_zone_position_now = in.read_u16();
-                       in.ensureBytes(2);
-                       short float f_zone_size = in.read_u16();
-       
-                in.ensureBytes(1);
-                unsigned flags2 = in.read_u8(); // 6 bits are resered, 1 for 
f_zone_y, 1 for f_zone_
-       
-//         referencedFont->f_font2_id_ref=;
-//         referencedFont->f_csm_table_hint=2;
-//         referencedFont->f_reserved=6;
-//         referencedFont->f_zones=
-
-
-        in.ensureBytes(1);
-       unsigned short f_r_y_x = in.read_u8(); // must reference a valid 
DEFINEFONT3 tag
-*/     
-
-//     boost::uint16_t id = referencedFont->fontID;
-
-//     DefineFontAlignZonesTag* ch = new DefineFontAlignZonesTag(m,in);
-//     m.addControlTag(ch);
-
+       const boost::uint16_t csm_table_int_temp = flags >> 6;
+                       
+       Font::GlyphInfoRecords::size_type glyphs_count_temp =
+        referencedFont->glyphCount();
+
+       for (size_t i = 0; i != glyphs_count_temp; ++i) {
+        in.ensureBytes(1);
+        
+        in.read_u8();          
+        
+        for (int j = 0; j != 2; ++j) {
+            in.ensureBytes(2);
+            float f_zone_position_temp = in.read_u16();
+            in.ensureBytes(2);
+            float f_zone_size_temp = in.read_u16();
+        }              
+        in.ensureBytes(1);
+        
+        // What is this?
+        boost::uint8_t u = in.read_u8();
+        const boost::uint32_t f_zone_x_temp = u & 0x0001;
+        unsigned f_zone_y_temp = (u >> 1) & 0x0001;
+                       
+    }
        in.skip_to_tag_end();
        LOG_ONCE(log_unimpl(_("*** DefineFontAlignZoneTag")));
 

=== modified file 'libcore/vm/ActionExec.cpp'
--- a/libcore/vm/ActionExec.cpp 2009-12-02 15:57:58 +0000
+++ b/libcore/vm/ActionExec.cpp 2009-12-09 13:49:55 +0000
@@ -34,6 +34,7 @@
 #include "ASHandlers.h"
 #include "as_environment.h"
 #include "debugger.h"
+#include "SystemClock.h"
 
 #include <sstream>
 #include <string>
@@ -178,9 +179,6 @@
     );
 #endif
 
-    // TODO: specify in the .gnashrc !!
-    static const size_t maxBranchCount = 65536; // what's enough ?
-
     // stop_pc: set to the code boundary at which we should check
     // for exceptions. If there is no exception in a TryBlock, it
     // is set to the end of that block; all the code (including catch
@@ -193,9 +191,11 @@
     // code. There may be no catch and/or finally block, but certain operations
     // must still be carried out. 
 
-    size_t branchCount = 0;
+    // TODO: set this in gnashrc.
+    const size_t maxTime = 40 * 1000;
+    SystemClock clock;
+
     try {
-        //log_debug("Try list size: %s", _tryList.size());
 
         // We might not stop at stop_pc, if we are trying.
         while (1) {
@@ -331,14 +331,9 @@
 
             // Check for script limits hit. 
             // See: http://www.gnashdev.org/wiki/index.php/ScriptLimits
-            if (pc <= oldPc) {
-                if (++branchCount > maxBranchCount) {
-                    boost::format fmt(_("Loop iterations count exceeded "
-                                "limit of %d. Last branch was from pc %d "
-                                "to %d"));
-                    fmt % maxBranchCount % oldPc % pc;
-                    throw ActionLimitException(fmt.str());
-                }
+            if (pc <= oldPc && clock.elapsed() > maxTime) {
+                boost::format fmt(_("Time exceeded"));
+                throw ActionLimitException(fmt.str());
             }
         }
     }
@@ -346,12 +341,12 @@
         // Class execution should stop (for this frame only?)
         // Here's were we should pop-up a window to prompt user about
         // what to do next (abort or not ?)
-        cleanupAfterRun(true); // we expect inconsistencies here
+        cleanupAfterRun(); // we expect inconsistencies here
         throw;
     }
     catch (ActionScriptException& ex) {
         // An unhandled ActionScript exception was thrown.
-        cleanupAfterRun(true);
+        cleanupAfterRun();
 
         // Forceably clear the stack.
         // - Fixes misc-mtasc.all/exception.swf
@@ -567,13 +562,11 @@
     return true;
 }
 
-/*private*/
 void
-ActionExec::cleanupAfterRun(bool /*expectInconsistencies*/) // TODO: drop 
argument...
+ActionExec::cleanupAfterRun() 
 {
     VM& vm = getVM(env);
 
-    //assert(_originalTarget); // this execution context might have been 
started while target had a null target
     env.set_target(_originalTarget);
     _originalTarget = NULL;
 
@@ -584,8 +577,8 @@
         // check if the stack was smashed
         if ( _initialStackSize > env.stack_size() )
         {
-            log_swferror(_("Stack smashed (ActionScript compiler bug, or 
obfuscated SWF)."
-                 " Taking no action to fix (as expected)."));
+            log_swferror(_("Stack smashed (ActionScript compiler bug, or "
+                    "obfuscated SWF).Taking no action to fix (as expected)."));
         }
         else if ( _initialStackSize < env.stack_size() )
         {

=== modified file 'libcore/vm/ActionExec.h'
--- a/libcore/vm/ActionExec.h   2009-11-13 08:18:42 +0000
+++ b/libcore/vm/ActionExec.h   2009-12-09 13:49:55 +0000
@@ -137,13 +137,7 @@
        /// calls in DOACTION block before frame actions queued by the same
        /// cause (the latter would be pushed in the same level gotoFrame is
        /// found)
-       ///
-       /// @param expectInconsistencies
-       ///     If true, don't print an error if stack is bigger or smaller
-       ///     then we expect. The parameter is used when calling the
-       ///     cleanup function due to a thrown ActionLimitException.
-       ///
-       void cleanupAfterRun(bool expectInconsistencies=false);
+       void cleanupAfterRun();
 
        /// the 'with' stack associated with this execution thread
        std::vector<with_stack_entry> _withStack;


reply via email to

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