From ca68fbc075daaaefe51269faa84df722a3d7b323 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Wed, 24 Sep 2014 23:17:50 +0000 Subject: [PATCH] Rename Cabinet member variables to avoid using reserved identifiers Names containing double underscores are reserved for the C++ implementation. --- include/cantera/base/config.h.in | 2 +- src/clib/Cabinet.h | 14 +++++++------- src/clib/ct.cpp | 6 +++--- src/clib/ctfunc.cpp | 2 +- src/clib/ctmultiphase.cpp | 2 +- src/clib/ctonedim.cpp | 4 ++-- src/clib/ctreactor.cpp | 8 ++++---- src/clib/ctrpath.cpp | 4 ++-- src/clib/ctxml.cpp | 2 +- src/fortran/fctxml.cpp | 2 +- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/include/cantera/base/config.h.in b/include/cantera/base/config.h.in index bf0739e0b..3ca18b392 100644 --- a/include/cantera/base/config.h.in +++ b/include/cantera/base/config.h.in @@ -84,7 +84,7 @@ typedef int ftnlen; // Fortran hidden string length type // in that system , you need to declare the static storage variable. // with the following line in the include file // -// template Cabinet* Cabinet::__storage; +// template Cabinet* Cabinet::s_storage; // // Note, on other systems that declaration is treated as a definition // and this leads to multiple defines at link time diff --git a/src/clib/Cabinet.h b/src/clib/Cabinet.h index 72bbc920a..1add3b736 100644 --- a/src/clib/Cabinet.h +++ b/src/clib/Cabinet.h @@ -193,7 +193,7 @@ public: * Constructor. */ Cabinet() { - __table.push_back(new M); + m_table.push_back(new M); } private: @@ -203,21 +203,21 @@ private: * access the data through this function. */ static dataRef getData() { - if (__storage == 0) { - __storage = new Cabinet(); + if (s_storage == 0) { + s_storage = new Cabinet(); } - return __storage->__table; + return s_storage->m_table; } /** * Pointer to the single instance of this class. */ - static Cabinet* __storage; + static Cabinet* s_storage; /** * Vector to hold pointers to objects. */ - std::vector __table; + std::vector m_table; }; //! Declaration stating that the storage for the static member @@ -226,7 +226,7 @@ private: * The actual storage will be allocated in .cpp files */ #ifdef NEEDS_GENERIC_TEMPL_STATIC_DECL -template Cabinet* Cabinet::__storage; +template Cabinet* Cabinet::s_storage; #endif #endif diff --git a/src/clib/ct.cpp b/src/clib/ct.cpp index 12c4249f1..0235dd1bc 100644 --- a/src/clib/ct.cpp +++ b/src/clib/ct.cpp @@ -30,9 +30,9 @@ typedef Cabinet KineticsCabinet; typedef Cabinet TransportCabinet; typedef Cabinet XmlCabinet; -template<> ThermoCabinet* ThermoCabinet::__storage = 0; -template<> KineticsCabinet* KineticsCabinet::__storage = 0; -template<> TransportCabinet* TransportCabinet::__storage = 0; +template<> ThermoCabinet* ThermoCabinet::s_storage = 0; +template<> KineticsCabinet* KineticsCabinet::s_storage = 0; +template<> TransportCabinet* TransportCabinet::s_storage = 0; /** * Exported functions. diff --git a/src/clib/ctfunc.cpp b/src/clib/ctfunc.cpp index 1ee64b6c6..55bc5c74a 100644 --- a/src/clib/ctfunc.cpp +++ b/src/clib/ctfunc.cpp @@ -16,7 +16,7 @@ typedef Func1 func_t; typedef Cabinet FuncCabinet; // Assign storage to the Cabinet static member -template<> FuncCabinet* FuncCabinet::__storage = 0; +template<> FuncCabinet* FuncCabinet::s_storage = 0; extern "C" { diff --git a/src/clib/ctmultiphase.cpp b/src/clib/ctmultiphase.cpp index b00446770..52d9dab6c 100644 --- a/src/clib/ctmultiphase.cpp +++ b/src/clib/ctmultiphase.cpp @@ -15,7 +15,7 @@ using namespace std; using namespace Cantera; typedef Cabinet mixCabinet; -template<> mixCabinet* mixCabinet::__storage = 0; +template<> mixCabinet* mixCabinet::s_storage = 0; extern "C" { diff --git a/src/clib/ctonedim.cpp b/src/clib/ctonedim.cpp index 7ebba02c9..cabad8a55 100644 --- a/src/clib/ctonedim.cpp +++ b/src/clib/ctonedim.cpp @@ -18,8 +18,8 @@ using namespace Cantera; typedef Cabinet SimCabinet; typedef Cabinet DomainCabinet; -template<> SimCabinet* SimCabinet::__storage = 0; -template<> DomainCabinet* DomainCabinet::__storage = 0; +template<> SimCabinet* SimCabinet::s_storage = 0; +template<> DomainCabinet* DomainCabinet::s_storage = 0; typedef Cabinet ThermoCabinet; typedef Cabinet KineticsCabinet; diff --git a/src/clib/ctreactor.cpp b/src/clib/ctreactor.cpp index c9ccaafba..59ed14095 100644 --- a/src/clib/ctreactor.cpp +++ b/src/clib/ctreactor.cpp @@ -24,10 +24,10 @@ typedef Cabinet FuncCabinet; typedef Cabinet ThermoCabinet; typedef Cabinet KineticsCabinet; -template<> ReactorCabinet* ReactorCabinet::__storage = 0; -template<> NetworkCabinet* NetworkCabinet::__storage = 0; -template<> FlowDeviceCabinet* FlowDeviceCabinet::__storage = 0; -template<> WallCabinet* WallCabinet::__storage = 0; +template<> ReactorCabinet* ReactorCabinet::s_storage = 0; +template<> NetworkCabinet* NetworkCabinet::s_storage = 0; +template<> FlowDeviceCabinet* FlowDeviceCabinet::s_storage = 0; +template<> WallCabinet* WallCabinet::s_storage = 0; extern "C" { diff --git a/src/clib/ctrpath.cpp b/src/clib/ctrpath.cpp index e2a646737..330973f1c 100644 --- a/src/clib/ctrpath.cpp +++ b/src/clib/ctrpath.cpp @@ -15,8 +15,8 @@ using namespace std; typedef Cabinet BuilderCabinet; typedef Cabinet DiagramCabinet; -template<> DiagramCabinet* DiagramCabinet::__storage = 0; -template<> BuilderCabinet* BuilderCabinet::__storage = 0; +template<> DiagramCabinet* DiagramCabinet::s_storage = 0; +template<> BuilderCabinet* BuilderCabinet::s_storage = 0; typedef Cabinet KineticsCabinet; diff --git a/src/clib/ctxml.cpp b/src/clib/ctxml.cpp index b10c4828f..0ef390f80 100644 --- a/src/clib/ctxml.cpp +++ b/src/clib/ctxml.cpp @@ -16,7 +16,7 @@ using namespace Cantera; using namespace ctml; typedef Cabinet XmlCabinet; -template<> XmlCabinet* XmlCabinet::__storage = 0; +template<> XmlCabinet* XmlCabinet::s_storage = 0; extern "C" { diff --git a/src/fortran/fctxml.cpp b/src/fortran/fctxml.cpp index c23bbb044..c51e032df 100644 --- a/src/fortran/fctxml.cpp +++ b/src/fortran/fctxml.cpp @@ -20,7 +20,7 @@ using Cantera::handleAllExceptions; #include "clib/Cabinet.h" typedef Cabinet XmlCabinet; -template<> XmlCabinet* XmlCabinet::__storage = 0; +template<> XmlCabinet* XmlCabinet::s_storage = 0; typedef integer status_t;