gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] /srv/bzr/gnash/trunk r12121: Coding style cleanups, fix c


From: Benjamin Wolsey
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r12121: Coding style cleanups, fix compiler warnings.
Date: Wed, 31 Mar 2010 11:02:14 +0200
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 12121 [merge]
committer: Benjamin Wolsey <address@hidden>
branch nick: trunk
timestamp: Wed 2010-03-31 11:02:14 +0200
message:
  Coding style cleanups, fix compiler warnings.
modified:
  libbase/rc.h
  libcore/RunResources.h
  libcore/as_object.h
  libcore/asobj/Global_as.h
  libcore/asobj/Globals.cpp
  libcore/asobj/Globals.h
=== modified file 'libbase/rc.h'
--- a/libbase/rc.h      2010-03-14 02:26:46 +0000
+++ b/libbase/rc.h      2010-03-31 08:20:52 +0000
@@ -247,10 +247,10 @@
     void setHWAccel(const std::string &x) { _hwaccel = x; }
 
     // Get the name of the hardware acclerator to use for video
-    const std::string &getRenderer() const { return _renderer; }
+    const std::string& getRenderer() const { return _renderer; }
 
     // Set the name of the hardware acclerator to use for video
-    void setRendeer(const std::string &x) { _renderer = x; }
+    void setRenderer(const std::string& x) { _renderer = x; }
 
     // Get the location of the sandbox for .sol files
     const std::string &getSOLSafeDir() const { return _solsandbox; }

=== modified file 'libcore/RunResources.h'
--- a/libcore/RunResources.h    2010-03-14 02:26:46 +0000
+++ b/libcore/RunResources.h    2010-03-31 08:24:41 +0000
@@ -57,7 +57,7 @@
     RunResources(const std::string& baseURL)
         :
         _baseURL(baseURL)
-    { /* do nothing */  }
+    {}
 
     /// Get the base URL for the run.
     //
@@ -129,14 +129,14 @@
     /// Set the renderer backend, agg, opengl, or cairo. This is set
     /// in the users gnashrc file, or can be overridden with the
     /// --hwaccel option to gnash.
-    void setRenderBackend(const std::string &x) {_renderer_backend = x; }
-    std::string &getRenderBackend() { return _renderer_backend; }
+    void setRenderBackend(const std::string& x) { _renderer_backend = x; }
+    std::string& getRenderBackend() { return _renderer_backend; }
 
     /// Set the hardware video accleration backend, none, vaapi, xv,
     /// or cairo. This is set in the users gnashrc file, or can be
     /// overridden with the --render-mode option to gnash.
-    std::string &getHWAccelBackend() { return _hwaccel_backend; }
-    void setHWAccelBackend(const std::string &x) {_hwaccel_backend = x; }
+    std::string& getHWAccelBackend() { return _hwaccel_backend; }
+    void setHWAccelBackend(const std::string& x) { _hwaccel_backend = x; }
 #endif
 
 private:

=== modified file 'libcore/as_object.h'
--- a/libcore/as_object.h       2010-03-22 23:46:33 +0000
+++ b/libcore/as_object.h       2010-03-31 08:08:58 +0000
@@ -824,8 +824,6 @@
     /// Mark properties and triggers list as reachable (for the GC)
     void markAsObjectReachable() const;
 
-    /// The VM containing this object.
-    VM& _vm;   
 private:
 
     /// Find an existing property for update
@@ -868,6 +866,9 @@
     /// destructor is called.
     boost::scoped_ptr<Relay> _relay;
 
+    /// The VM containing this object.
+    VM& _vm;
+
     /// Properties of this as_object
     PropertyList _members;
 

=== modified file 'libcore/asobj/Global_as.h'
--- a/libcore/asobj/Global_as.h 2010-03-22 23:46:33 +0000
+++ b/libcore/asobj/Global_as.h 2010-03-31 07:56:49 +0000
@@ -60,7 +60,8 @@
     virtual ClassHierarchy& classHierarchy() = 0;
 
     explicit Global_as(VM& vm)
-      : as_object(vm)
+        :
+        as_object(vm)
     {}
 
     /// Create an ActionScript function

=== modified file 'libcore/asobj/Globals.cpp'
--- a/libcore/asobj/Globals.cpp 2010-03-22 23:46:33 +0000
+++ b/libcore/asobj/Globals.cpp 2010-03-31 08:08:58 +0000
@@ -291,29 +291,32 @@
     as_value nullVal; nullVal.set_null();
     init_member("o", nullVal, PropFlags::dontEnum);
 
+
+    VM& vm = getVM();
+
     // _global functions.            
     // These functions are only available in SWF6+, but this is just
     // because SWF5 or lower did not have a "_global"
     // reference at all.
     init_member("ASnative", createFunction(global_asnative));
     init_member("ASconstructor", createFunction(global_asconstructor));
-    init_member("ASSetPropFlags", _vm.getNative(1, 0));
-    init_member("ASSetNative", _vm.getNative(4, 0));
-    init_member("ASSetNativeAccessor", _vm.getNative(4, 1));
+    init_member("ASSetPropFlags", vm.getNative(1, 0));
+    init_member("ASSetNative", vm.getNative(4, 0));
+    init_member("ASSetNativeAccessor", vm.getNative(4, 1));
     init_member("AsSetupError", createFunction(global_assetuperror));
-    init_member("updateAfterEvent", _vm.getNative(9, 0));
-    init_member("trace", _vm.getNative(100, 4));
+    init_member("updateAfterEvent", vm.getNative(9, 0));
+    init_member("trace", vm.getNative(100, 4));
 
-    init_member("setInterval", _vm.getNative(250, 0));
-    init_member("clearInterval", _vm.getNative(250, 1));
-    init_member("setTimeout", _vm.getNative(250, 2));
+    init_member("setInterval", vm.getNative(250, 0));
+    init_member("clearInterval", vm.getNative(250, 1));
+    init_member("setTimeout", vm.getNative(250, 2));
  
     // This is an odd function with no properties. There ought to be
     // a better way of implementing this. See also TextFormat.getTextExtent.
     as_function* edc = createFunction(global_enableDebugConsole);
     edc->clearProperties();
     init_member("enableDebugConsole", edc);
-    init_member("showRedrawRegions", _vm.getNative(1021, 1));
+    init_member("showRedrawRegions", vm.getNative(1021, 1));
     
     string_table& st = getStringTable(*this);
     init_member("clearTimeout", getMember(st.find("clearInterval")));
@@ -324,7 +327,7 @@
     const string_table::key NS_FLASH = st.find("flash");
     flash_package_init(*this, NS_FLASH); 
 
-    const int version = _vm.getSWFVersion();
+    const int version = vm.getSWFVersion();
 
     switch (version)
     {
@@ -340,12 +343,12 @@
         
             // This is surely not correct, but they are not available
             // in SWF4
-            init_member("escape", _vm.getNative(100, 0));
-            init_member("unescape", _vm.getNative(100, 1));
-            init_member("parseInt", _vm.getNative(100, 2));
-            init_member("parseFloat", _vm.getNative(100, 3));
-            init_member("isNaN", _vm.getNative(200, 18));
-            init_member("isFinite", _vm.getNative(200, 19));
+            init_member("escape", vm.getNative(100, 0));
+            init_member("unescape", vm.getNative(100, 1));
+            init_member("parseInt", vm.getNative(100, 2));
+            init_member("parseFloat", vm.getNative(100, 3));
+            init_member("isNaN", vm.getNative(200, 18));
+            init_member("isFinite", vm.getNative(200, 19));
 
             init_member("NaN", as_value(NaN));
             init_member("Infinity", as_value(

=== modified file 'libcore/asobj/Globals.h'
--- a/libcore/asobj/Globals.h   2010-03-22 23:46:33 +0000
+++ b/libcore/asobj/Globals.h   2010-03-31 08:08:58 +0000
@@ -89,7 +89,7 @@
     }
 
     virtual VM& getVM() const {
-        return _vm;
+        return vm();
     }
     
     /// Create an ActionScript function
@@ -160,7 +160,7 @@
     }
     
     virtual VM& getVM() const {
-        return _vm;
+        return vm();
     }
 
 protected:


reply via email to

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