Bug 569629 - Remove static xpcom modules list static initializer. r=bsmedberg,a=bsmedberg
authorMike Hommey <mh+mozilla@glandium.org>
Sun, 07 Nov 2010 09:25:38 +0100
changeset 57049 73389f240593fbb330b2329ada18a270ce98a48c
parent 57048 4f11a96707f7700ef77536821acb68b1ccaaabb5
child 57050 831b92ba7fc5505d6bbda5cb4d288006e10216c4
push id16768
push usermh@glandium.org
push dateSun, 07 Nov 2010 08:26:25 +0000
treeherdermozilla-central@0a9ee83b1093 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg, bsmedberg
bugs569629
milestone2.0b8pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 569629 - Remove static xpcom modules list static initializer. r=bsmedberg,a=bsmedberg
config/nsStaticComponents.cpp.in
config/nsStaticComponents.h
toolkit/library/nsStaticXULComponents.cpp
toolkit/xre/nsAppRunner.cpp
xpcom/components/nsComponentManager.cpp
--- a/config/nsStaticComponents.cpp.in
+++ b/config/nsStaticComponents.cpp.in
@@ -54,20 +54,18 @@
 
 %MODULE_LIST%
 #line 57 "nsStaticComponents.cpp.in"
 
 #undef MODULE
 
 
 #define MODULE(_name) \
-    NSMODULE_NAME(_name),
+    &NSMODULE_NAME(_name),
 
 /**
  * The nsStaticModuleInfo
  */
-static const mozilla::Module *const kStaticModules[] = {
+const mozilla::Module *const *const kPStaticModules[] = {
 	%MODULE_LIST%
 #line 70 "nsStaticComponents.cpp.in"
         NULL
 };
-
-mozilla::Module const *const *const kPStaticModules = kStaticModules;
--- a/config/nsStaticComponents.h
+++ b/config/nsStaticComponents.h
@@ -38,11 +38,11 @@
 #ifndef nsStaticComponents_h__
 #define nsStaticComponents_h__
 
 #include "mozilla/Module.h"
 
 // These symbols are provided by nsStaticComponents.cpp, and also by other
 // static component providers such as nsStaticXULComponents (libxul).
 
-extern mozilla::Module const *const *const kPStaticModules;
+extern mozilla::Module const *const *const kPStaticModules[];
 
 #endif
--- a/toolkit/library/nsStaticXULComponents.cpp
+++ b/toolkit/library/nsStaticXULComponents.cpp
@@ -294,18 +294,16 @@
 #define MODULE(_name) \
   NSMODULE_DECL(_name);
 
 XUL_MODULES
 
 #undef MODULE
 
 #define MODULE(_name) \
-    NSMODULE_NAME(_name),
+    &NSMODULE_NAME(_name),
 
-static const mozilla::Module *const kStaticModules[] = {
+const mozilla::Module *const *const kPStaticModules[] = {
   XUL_MODULES
   NULL
 };
 
 #undef MODULE
-
-mozilla::Module const *const *const kPStaticModules = kStaticModules;
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -1173,19 +1173,19 @@ ScopedXPCOMStartup::Initialize()
   NS_ASSERTION(gDirServiceProvider, "Should not get here!");
 
   nsresult rv;
 
 #ifndef MOZ_ENABLE_LIBXUL
 #ifndef _BUILD_STATIC_BIN
   XRE_AddStaticComponent(&kXREModule);
 #else
-  for (const mozilla::Module *const *staticModules = kPStaticModules;
+  for (const mozilla::Module *const *const *staticModules = kPStaticModules;
        *staticModules; ++staticModules)
-      XRE_AddStaticComponent(*staticModules);
+      XRE_AddStaticComponent(**staticModules);
 #endif
 #endif
 
   rv = NS_InitXPCOM2(&mServiceManager, gDirServiceProvider->GetAppDir(),
                      gDirServiceProvider);
   if (NS_FAILED(rv)) {
     NS_ERROR("Couldn't start xpcom!");
     mServiceManager = nsnull;
--- a/xpcom/components/nsComponentManager.cpp
+++ b/xpcom/components/nsComponentManager.cpp
@@ -310,19 +310,19 @@ nsTArray<const mozilla::Module*>* nsComp
 /* static */ void
 nsComponentManagerImpl::InitializeStaticModules()
 {
     if (sStaticModules)
         return;
 
     sStaticModules = new nsTArray<const mozilla::Module*>;
 #ifdef MOZ_ENABLE_LIBXUL
-    for (const mozilla::Module *const *staticModules = kPStaticModules;
+    for (const mozilla::Module *const *const *staticModules = kPStaticModules;
          *staticModules; ++staticModules)
-        sStaticModules->AppendElement(*staticModules);
+        sStaticModules->AppendElement(**staticModules);
 #endif
 }
 
 nsTArray<nsComponentManagerImpl::ComponentLocation>*
 nsComponentManagerImpl::sModuleLocations;
 
 /* static */ void
 nsComponentManagerImpl::InitializeModuleLocations()