gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r10150: Make tag namespaces into cla


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r10150: Make tag namespaces into classes for consistency and doxygen satisfaction.
Date: Mon, 27 Oct 2008 17:52:42 +0100
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 10150
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Mon 2008-10-27 17:52:42 +0100
message:
  Make tag namespaces into classes for consistency and doxygen satisfaction.
modified:
  libcore/swf/DefineButtonCxformTag.h
  libcore/swf/ScriptLimitsTag.h
=== modified file 'libcore/swf/DefineButtonCxformTag.h'
--- a/libcore/swf/DefineButtonCxformTag.h       2008-09-04 15:32:42 +0000
+++ b/libcore/swf/DefineButtonCxformTag.h       2008-10-27 16:52:42 +0000
@@ -33,44 +33,46 @@
 /// scriptlimits setting, so this is kept in movie_root rather than the
 /// immutable movie_definition. Whenever this tag is parsed, the value in
 /// movie_root is overridden.
-namespace DefineButtonCxformTag
-{
-
-void loader(SWFStream& in, tag_type tag, movie_definition& m)
-{
-
-    assert(tag == SWF::DEFINEBUTTONCXFORM);
-
-    in.ensureBytes(2);
-    const boost::uint16_t buttonID = in.read_u16();
-
-    IF_VERBOSE_PARSE (
-        log_debug("DefineButtonCxformTag: ButtonId=%d", buttonID);
-    );
-    
-    character_def* chdef = m.get_character_def(buttonID);
-    if ( ! chdef )
-    {
-        IF_VERBOSE_MALFORMED_SWF(
-        log_swferror(_("DefineButtonCxform refers to an unknown character 
%d"), buttonID);
-        );
-        return;
-    }
-
-    button_character_definition* ch = 
dynamic_cast<button_character_definition*> (chdef);
-    if ( ! ch )
-    {
-        IF_VERBOSE_MALFORMED_SWF(
-        log_swferror(_("DefineButtonCxform refers to character ID %d (%s)."
-                  " Expected a button definition"),
-                  buttonID, typeName(*chdef));
-        );
-        return;
-    }
+class DefineButtonCxformTag
+{
+public:
+    static void loader(SWFStream& in, tag_type tag, movie_definition& m)
+    {
+
+        assert(tag == SWF::DEFINEBUTTONCXFORM);
+
+        in.ensureBytes(2);
+        const boost::uint16_t buttonID = in.read_u16();
+
+        IF_VERBOSE_PARSE (
+            log_debug("DefineButtonCxformTag: ButtonId=%d", buttonID);
+        );
+        
+        character_def* chdef = m.get_character_def(buttonID);
+        if ( ! chdef )
+        {
+            IF_VERBOSE_MALFORMED_SWF(
+            log_swferror(_("DefineButtonCxform refers to an unknown "
+                    "character %d"), buttonID);
+            );
+            return;
+        }
+
+        button_character_definition* ch = 
+            dynamic_cast<button_character_definition*> (chdef);
+        if ( ! ch )
+        {
+            IF_VERBOSE_MALFORMED_SWF(
+            log_swferror(_("DefineButtonCxform refers to character ID %d (%s)."
+                      " Expected a button definition"),
+                      buttonID, typeName(*chdef));
+            );
+            return;
+        }
 
     ch->readDefineButtonCxform(in, m);
     }
-}
+};
 
 } // namespace gnash::SWF
 } // namespace gnash

=== modified file 'libcore/swf/ScriptLimitsTag.h'
--- a/libcore/swf/ScriptLimitsTag.h     2008-09-04 15:32:42 +0000
+++ b/libcore/swf/ScriptLimitsTag.h     2008-10-27 16:52:42 +0000
@@ -31,9 +31,11 @@
 /// scriptlimits setting, so this is kept in movie_root rather than the
 /// immutable movie_definition. Whenever this tag is parsed, the value in
 /// movie_root is overridden.
-namespace ScriptLimitsTag
+class ScriptLimitsTag
 {
-    void loader(SWFStream& in, tag_type tag, movie_definition& /*m*/)
+public:
+
+    static void loader(SWFStream& in, tag_type tag, movie_definition& /*m*/)
     {
 
         assert(VM::isInitialized());
@@ -54,7 +56,7 @@
 
         r.setScriptLimits(recursionLimit, timeoutLimit);
     }
-}
+};
 
 } // namespace gnash::SWF
 } // namespace gnash


reply via email to

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