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. 69ab47b535acb708da52


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. 69ab47b535acb708da52f8b2e46b8c2d00e45ed4
Date: Sun, 05 Dec 2010 17:48:17 +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  69ab47b535acb708da52f8b2e46b8c2d00e45ed4 (commit)
       via  ff1cb35d7486dee6a11e5a741a48bd6bb87f42d4 (commit)
       via  9fce470e2803921ed432d47acd57f4c72046cc8b (commit)
       via  771787535e2c4443bd33569aa1c2314581d90c10 (commit)
      from  8fb86a47107dbfcf662daa1f92bd19b2b58891af (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=69ab47b535acb708da52f8b2e46b8c2d00e45ed4


commit 69ab47b535acb708da52f8b2e46b8c2d00e45ed4
Author: Benjamin Wolsey <address@hidden>
Date:   Sun Dec 5 13:35:14 2010 +0100

    Drop static.

diff --git a/libcore/asobj/System_as.cpp b/libcore/asobj/System_as.cpp
index b96c20e..5f273d5 100644
--- a/libcore/asobj/System_as.cpp
+++ b/libcore/asobj/System_as.cpp
@@ -18,9 +18,13 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
+#include "System_as.h"
+
+#include <sstream>
+#include <string>
+
 #include "movie_root.h" // interface callback
 #include "log.h"
-#include "System_as.h"
 #include "fn_call.h"
 #include "smart_ptr.h" // for boost intrusive_ptr
 #include "Global_as.h"
@@ -30,8 +34,6 @@
 #include "GnashAlgorithm.h"
 #include "RunResources.h"
 
-#include <sstream>
-
 namespace gnash {
 
 
@@ -43,7 +45,7 @@ namespace {
     template<typename T> inline void convertValue(const std::string& in,
                                                   T& val);
 
-    const std::string& systemLanguage(as_object& proto);
+    std::string systemLanguage(as_object& proto);
 
     as_value system_security_allowdomain(const fn_call& fn);
     as_value system_security_allowinsecuredomain(const fn_call& fn);
@@ -55,7 +57,6 @@ namespace {
     void attachSystemSecurityInterface(as_object& o);
     void attachSystemCapabilitiesInterface(as_object& o);
     void attachSystemInterface(as_object& proto);
-
 }
 
 void
@@ -314,7 +315,7 @@ as_value
 system_security_allowdomain(const fn_call& fn)
 {
     LOG_ONCE(log_unimpl("System.security.allowDomain"));
-    if (fn.nargs < 1) {
+    if (!fn.nargs) {
         return as_value(false);
     }
     return as_value(true);
@@ -324,7 +325,7 @@ system_security_allowdomain(const fn_call& fn)
 as_value
 system_security_allowinsecuredomain(const fn_call& /*fn*/)
 {
-    LOG_ONCE(log_unimpl ("System.security.allowInsecureDomain") );
+    LOG_ONCE(log_unimpl("System.security.allowInsecureDomain"));
     return as_value();
 }
 
@@ -332,21 +333,21 @@ system_security_allowinsecuredomain(const fn_call& /*fn*/)
 as_value
 system_security_loadpolicyfile(const fn_call& /*fn*/)
 {
-    LOG_ONCE(log_unimpl ("System.security.loadPolicyFile") );
+    LOG_ONCE(log_unimpl("System.security.loadPolicyFile"));
     return as_value();
 }
 
 as_value
 system_setClipboard(const fn_call& /*fn*/)
 {
-    LOG_ONCE(log_unimpl ("System.setClipboard") );
+    LOG_ONCE(log_unimpl("System.setClipboard"));
     return as_value();
 }
 
 as_value
 system_showsettings(const fn_call& /*fn*/)
 {
-    LOG_ONCE(log_unimpl ("System.showSettings") );
+    LOG_ONCE(log_unimpl("System.showSettings"));
     return as_value();
 }
 
@@ -357,16 +358,13 @@ system_showsettings(const fn_call& /*fn*/)
 as_value
 system_exactsettings(const fn_call& fn)
 {
-
     // Getter
     if (fn.nargs == 0) {
         // Is always true until we implement it.
         return as_value(true);   
     }
-    
-    // Setter
     else {
-        LOG_ONCE(log_unimpl ("System.exactSettings") );
+        LOG_ONCE(log_unimpl("System.exactSettings"));
         return as_value();
     }
 }
@@ -379,23 +377,17 @@ as_value
 system_usecodepage(const fn_call& fn)
 {
     // Getter
-    if (fn.nargs == 0)
-    {
+    if (!fn.nargs) {
         // Is always false until we implement it.
         return as_value(false);   
     }
-    
-    // Setter
-    else 
-    {
+    else {
         LOG_ONCE(log_unimpl ("System.useCodepage") );
         return as_value();
     }
 }
 
-
-
-const std::string&
+std::string
 systemLanguage(as_object& proto)
 {
        // Two-letter language code ('en', 'de') corresponding to ISO 639-1
@@ -408,7 +400,7 @@ systemLanguage(as_object& proto)
        // some scripts rely on there being only 20 possible languages. It could
        // be a run time option if it's important enough to care.
 
-       static std::string lang = getVM(proto).getSystemLanguage();
+       std::string lang = getVM(proto).getSystemLanguage();
        
        const char* languages[] = {"en", "fr", "ko", "ja", "sv",
                                "de", "es", "it", "zh", "pt",
@@ -418,32 +410,27 @@ systemLanguage(as_object& proto)
        const size_t size = arraySize(languages);
        
        if (std::find(languages, languages + size, lang.substr(0, 2)) !=
-            languages + size)
-       {
-               if (lang.substr(0,2) == "zh")
-               {
+            languages + size) {
+               if (lang.substr(0, 2) == "zh") {
                        // Chinese is the only language since the pp version 7
                        // to need an additional qualifier.
                        if (lang.substr(2, 3) == "_TW") lang = "zh-TW";
                        else if (lang.substr(2, 3) == "_CN") lang = "zh-CN";
                        else lang = "xu";
                }
-               else
-               {
+               else {
                        // All other matching cases: retain just the first
                        // two DisplayObjects.
                        lang.erase(2);
                }
        }
-       else
-       {
+       else {
                // Unknown language. We also return this if
                // getSystemLanguage() returns something unexpected. 
                lang = "xu";
        }
 
        return lang;
-
 }
 
 } // anonymous namespace

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


commit ff1cb35d7486dee6a11e5a741a48bd6bb87f42d4
Author: Benjamin Wolsey <address@hidden>
Date:   Sun Dec 5 13:25:23 2010 +0100

    Don't waste space.

diff --git a/libcore/asobj/Global_as.cpp b/libcore/asobj/Global_as.cpp
index ca4a2c8..f474668 100644
--- a/libcore/asobj/Global_as.cpp
+++ b/libcore/asobj/Global_as.cpp
@@ -322,7 +322,6 @@ createObject(const Global_as& gl)
 void
 Global_as::loadExtensions()
 {
-
     if (RcInitFile::getDefaultInstance().enableExtensions()) {
         log_security(_("Extensions enabled, scanning plugin dir for load"));
         _et->scanAndLoad(*this);
@@ -330,7 +329,6 @@ Global_as::loadExtensions()
     else {
         log_security(_("Extensions disabled"));
     }
-
 }
 
 void
@@ -344,7 +342,6 @@ namespace {
 const ClassHierarchy::NativeClasses&
 avm1Classes()
 {
-
     typedef ClassHierarchy::NativeClass N;
 
     // Since we maintain separate lists for AVM1 and AVM2, these are all
@@ -387,7 +384,6 @@ avm1Classes()
         (N(accessibility_class_init, NSV::CLASS_ACCESSIBILITY, 5));
 
     return s;
-
 }
 
 as_value
@@ -596,7 +592,6 @@ global_parseint(const fn_call& fn)
 as_value
 global_assetpropflags(const fn_call& fn)
 {
-
     if (fn.nargs < 3) {
         IF_VERBOSE_ASCODING_ERRORS(    
             log_aserror(_("%s needs at least three arguments"), __FUNCTION__);
@@ -733,7 +728,6 @@ global_asnative(const fn_call& fn)
         return as_value();
     }
     return as_value(fun);
-        
 }
 
 // Obsolete ASnew function (exists only as ASnative(2, 0))
@@ -744,7 +738,6 @@ global_asnew(const fn_call& /*fn*/)
     return as_value();
 }
 
-
 /// ASSetNative(targetObject, major, properties, minor)
 //
 /// Sets a series of properties on targetObject using the native table.
@@ -950,7 +943,6 @@ global_assetuperror(const fn_call& fn)
 as_value
 global_setInterval(const fn_call& fn)
 {
-    
        if (fn.nargs < 2) {
                IF_VERBOSE_ASCODING_ERRORS(
                        std::stringstream ss; fn.dump_args(ss);
@@ -1024,7 +1016,6 @@ global_setInterval(const fn_call& fn)
 as_value
 global_setTimeout(const fn_call& fn)
 {
-    
        if (fn.nargs < 2) {
                IF_VERBOSE_ASCODING_ERRORS(
                        std::stringstream ss; fn.dump_args(ss);
@@ -1125,7 +1116,6 @@ global_enableDebugConsole(const fn_call& /*fn*/)
 void
 registerNatives(as_object& global)
 {
-    
     VM& vm = getVM(global);
 
     // ASNew was dropped as an API function but exists
@@ -1189,7 +1179,6 @@ registerNatives(as_object& global)
     registerLoadableNative(global);
     registerXMLNative(global);
     registerXMLNodeNative(global);
-
 }
 
 } // anonymous namespace

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


commit 9fce470e2803921ed432d47acd57f4c72046cc8b
Author: Benjamin Wolsey <address@hidden>
Date:   Sun Dec 5 13:22:49 2010 +0100

    Remove silly and unreachable logging message.

diff --git a/libcore/asobj/Global_as.cpp b/libcore/asobj/Global_as.cpp
index c2407b6..ca4a2c8 100644
--- a/libcore/asobj/Global_as.cpp
+++ b/libcore/asobj/Global_as.cpp
@@ -885,11 +885,8 @@ global_assetnativeaccessor(const fn_call& fn)
         ++i;
     }
     return as_value();
-    LOG_ONCE(log_unimpl("ASSetNativeAccessor"));
-    return as_value();
 }
 
-
 // updateAfterEvent function
 as_value
 global_updateAfterEvent(const fn_call& /*fn*/)

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


commit 771787535e2c4443bd33569aa1c2314581d90c10
Author: Benjamin Wolsey <address@hidden>
Date:   Sun Dec 5 13:22:26 2010 +0100

    Remove silly switch.

diff --git a/libcore/asobj/Global_as.cpp b/libcore/asobj/Global_as.cpp
index e27b38d..c2407b6 100644
--- a/libcore/asobj/Global_as.cpp
+++ b/libcore/asobj/Global_as.cpp
@@ -281,23 +281,12 @@ Global_as::registerClasses()
     _classes.declareAll(avm1Classes());
 
     // SWF8 visibility:
-    const ObjectURI& NS_FLASH = getURI(vm, "flash");
-    flash_package_init(*this, NS_FLASH); 
+    const ObjectURI& flash = getURI(vm, "flash");
+    flash_package_init(*this, flash); 
 
     const int version = vm.getSWFVersion();
 
-    switch (version)
-    {
-        default:
-            // Version 10 or above reported
-        case 9:
-        case 8:
-
-        case 7:
-        case 6:
-
-        case 5:
-        
+    if (version > 4) {
             // This is surely not correct, but they are not available
             // in SWF4
             init_member("escape", vm.getNative(100, 0));
@@ -310,12 +299,6 @@ Global_as::registerClasses()
             init_member("NaN", as_value(NaN));
             init_member("Infinity", as_value(
                         std::numeric_limits<double>::infinity()));
-        
-        case 4:
-        case 3:
-        case 2:
-        case 1:
-            break;
     }
 
     loadExtensions();
@@ -429,7 +412,8 @@ global_isNaN(const fn_call& fn)
 {
     ASSERT_FN_ARGS_IS_1
 
-    return as_value(static_cast<bool>(isNaN(toNumber(fn.arg(0), getVM(fn)))));
+    return as_value(static_cast<bool>(isNaN(
+                    toNumber(fn.arg(0), getVM(fn)))));
 }
 
 
@@ -438,7 +422,8 @@ global_isfinite(const fn_call& fn)
 {
     ASSERT_FN_ARGS_IS_1
 
-    return as_value(static_cast<bool>(isFinite(toNumber(fn.arg(0), 
getVM(fn)))));
+    return as_value(static_cast<bool>(isFinite(
+                    toNumber(fn.arg(0), getVM(fn)))));
 }
 
 /// \brief Encode a string to URL-encoded format
@@ -531,21 +516,19 @@ global_parseint(const fn_call& fn)
     // 83, not 0; parseInt(" 0x123", 8) is 0), which is
     // why we do this here.
     size_t base;
-    if (fn.nargs > 1)
-    {
+    if (fn.nargs > 1) {
         base = toInt(fn.arg(1), getVM(fn));
     
         // Bases from 2 to 36 are valid, otherwise return NaN
         if (base < 2 || base > 36) return as_value(NaN);
     }
-    else
-    {
+    else {
         /// No radix specified, so try parsing as octal or hexadecimal
         try {
             double d;
             if (parseNonDecimalInt(expr, d, false)) return d;
         }
-        catch (boost::bad_lexical_cast&) {
+        catch (const boost::bad_lexical_cast&) {
             return as_value(NaN);
         }
 
@@ -574,8 +557,7 @@ global_parseint(const fn_call& fn)
     }    
 
     bool negative = false;
-    if (*it == '-' || *it == '+')
-    {
+    if (*it == '-' || *it == '+') {
         if (*it == '-') negative = true;
         
         it++;
@@ -630,7 +612,7 @@ global_assetpropflags(const fn_call& fn)
     
     // object
     boost::intrusive_ptr<as_object> obj = toObject(fn.arg(0), getVM(fn));
-    if ( ! obj ) {
+    if (!obj) {
         IF_VERBOSE_ASCODING_ERRORS(
         log_aserror(_("Invalid call to ASSetPropFlags: "
             "first argument is not an object: %s"),
@@ -677,7 +659,6 @@ global_assetpropflags(const fn_call& fn)
 as_value
 global_asconstructor(const fn_call& fn)
 {
-
     if (fn.nargs < 2) {
         IF_VERBOSE_ASCODING_ERRORS(    
             std::ostringstream ss; fn.dump_args(ss);
@@ -721,9 +702,7 @@ global_asconstructor(const fn_call& fn)
 as_value
 global_asnative(const fn_call& fn)
 {
-
-    if (fn.nargs < 2)
-    {
+    if (fn.nargs < 2) {
         IF_VERBOSE_ASCODING_ERRORS(    
             std::ostringstream ss; fn.dump_args(ss);
             log_aserror(_("ASNative(%s): needs at least two arguments"),
@@ -774,7 +753,6 @@ global_asnew(const fn_call& /*fn*/)
 as_value
 global_assetnative(const fn_call& fn)
 {
-
     if (fn.nargs < 3) {
         return as_value();
     }
diff --git a/libcore/asobj/flash/flash_pkg.cpp 
b/libcore/asobj/flash/flash_pkg.cpp
index 7f88c90..0198f5c 100644
--- a/libcore/asobj/flash/flash_pkg.cpp
+++ b/libcore/asobj/flash/flash_pkg.cpp
@@ -17,11 +17,11 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-#include "VM.h"
+#include "flash_pkg.h"
+
 #include "VM.h"
 #include "fn_call.h"
 #include "namedStrings.h"
-#include "flash_pkg.h"
 #include "display/display_pkg.h"
 #include "external/external_pkg.h"
 #include "filters/filters_pkg.h"

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

Summary of changes:
 libcore/asobj/Global_as.cpp       |   62 ++++++++-----------------------------
 libcore/asobj/System_as.cpp       |   53 ++++++++++++-------------------
 libcore/asobj/flash/flash_pkg.cpp |    4 +-
 3 files changed, 35 insertions(+), 84 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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