diff options
author | Jose <jose@zeroc.com> | 2009-08-04 22:18:24 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2009-08-04 22:18:24 +0200 |
commit | 618deb2618ca2698141773f1658071c372d2cd3b (patch) | |
tree | a09f5965e8bcfea07a305df61505af2c35a71cdf /cpp/src | |
parent | bug 4186 - PHP test failure (diff) | |
download | ice-618deb2618ca2698141773f1658071c372d2cd3b.tar.bz2 ice-618deb2618ca2698141773f1658071c372d2cd3b.tar.xz ice-618deb2618ca2698141773f1658071c372d2cd3b.zip |
4071 - Global namespace pollution
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/CommunicatorI.cpp | 12 | ||||
-rw-r--r-- | cpp/src/Ice/ConnectionFactory.cpp | 4 | ||||
-rw-r--r-- | cpp/src/Ice/Initialize.cpp | 6 | ||||
-rw-r--r-- | cpp/src/Ice/Reference.cpp | 5 | ||||
-rw-r--r-- | cpp/src/Ice/SliceChecksums.cpp | 10 | ||||
-rw-r--r-- | cpp/src/IcePatch2/ClientUtil.cpp | 10 | ||||
-rw-r--r-- | cpp/src/IceUtil/UUID.cpp | 5 |
7 files changed, 37 insertions, 15 deletions
diff --git a/cpp/src/Ice/CommunicatorI.cpp b/cpp/src/Ice/CommunicatorI.cpp index cc61ce97c52..86e1fc4fba1 100644 --- a/cpp/src/Ice/CommunicatorI.cpp +++ b/cpp/src/Ice/CommunicatorI.cpp @@ -35,6 +35,9 @@ IceUtil::Handle<IceInternal::GC> theCollector = 0; } +namespace +{ + struct GarbageCollectorStats { GarbageCollectorStats() : @@ -47,9 +50,6 @@ struct GarbageCollectorStats IceUtil::Time time; }; -namespace -{ - int communicatorCount = 0; IceUtil::Mutex* gcMutex = 0; GarbageCollectorStats gcStats; @@ -77,9 +77,7 @@ public: Init init; -} - -static void +void printGCStats(const IceInternal::GCStats& stats) { if(gcTraceLevel) @@ -96,6 +94,8 @@ printGCStats(const IceInternal::GCStats& stats) } } +} + void Ice::CommunicatorI::destroy() { diff --git a/cpp/src/Ice/ConnectionFactory.cpp b/cpp/src/Ice/ConnectionFactory.cpp index 84de59104d2..32de59ba16e 100644 --- a/cpp/src/Ice/ConnectionFactory.cpp +++ b/cpp/src/Ice/ConnectionFactory.cpp @@ -1345,7 +1345,7 @@ IceInternal::IncomingConnectionFactory::read(BasicStream&) return false; } -namespace IceInternal +namespace { class PromoteFollower @@ -1385,7 +1385,7 @@ IceInternal::IncomingConnectionFactory::message(BasicStream&, const ThreadPoolPt // If _threadPool is null, then this class doesn't do // anything. // - IceInternal::PromoteFollower promote(threadPool); + PromoteFollower promote(threadPool); if(_state != StateActive) { diff --git a/cpp/src/Ice/Initialize.cpp b/cpp/src/Ice/Initialize.cpp index ad9462dba2c..5b2e0b7d387 100644 --- a/cpp/src/Ice/Initialize.cpp +++ b/cpp/src/Ice/Initialize.cpp @@ -137,7 +137,7 @@ Ice::createProperties(int& argc, char* argv[], const PropertiesPtr& defaults, co return properties; } -namespace IceInternal +namespace { inline void checkIceVersion(Int version) @@ -188,7 +188,7 @@ inline void checkIceVersion(Int version) CommunicatorPtr Ice::initialize(int& argc, char* argv[], const InitializationData& initializationData, Int version) { - IceInternal::checkIceVersion(version); + checkIceVersion(version); InitializationData initData = initializationData; initData.properties = createProperties(argc, argv, initData.properties, initData.stringConverter); @@ -216,7 +216,7 @@ Ice::initialize(const InitializationData& initData, Int version) // We can't simply call the other initialize() because this one does NOT read // the config file, while the other one always does. // - IceInternal::checkIceVersion(version); + checkIceVersion(version); CommunicatorI* communicatorI = new CommunicatorI(initData); CommunicatorPtr result = communicatorI; // For exception safety. diff --git a/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp index 521699474ec..a77e098f225 100644 --- a/cpp/src/Ice/Reference.cpp +++ b/cpp/src/Ice/Reference.cpp @@ -1830,6 +1830,9 @@ IceInternal::RoutableReference::RoutableReference(const RoutableReference& r) : { } +namespace +{ + struct EndpointIsOpaque : public unary_function<EndpointIPtr, bool> { public: @@ -1841,6 +1844,8 @@ public: } }; +} + vector<EndpointIPtr> IceInternal::RoutableReference::filterEndpoints(const vector<EndpointIPtr>& allEndpoints) const { diff --git a/cpp/src/Ice/SliceChecksums.cpp b/cpp/src/Ice/SliceChecksums.cpp index 5e5b9f5fd73..122d01a4be9 100644 --- a/cpp/src/Ice/SliceChecksums.cpp +++ b/cpp/src/Ice/SliceChecksums.cpp @@ -14,10 +14,11 @@ using namespace std; using namespace Ice; -static SliceChecksumDict* _sliceChecksums = 0; namespace { +SliceChecksumDict* _sliceChecksums = 0; + IceUtil::Mutex* _mutex = 0; class Init @@ -38,8 +39,6 @@ public: Init init; -} - class SliceChecksumDictDestroyer { public: @@ -50,7 +49,10 @@ public: _sliceChecksums = 0; } }; -static SliceChecksumDictDestroyer destroyer; + +SliceChecksumDictDestroyer destroyer; + +} SliceChecksumDict Ice::sliceChecksums() diff --git a/cpp/src/IcePatch2/ClientUtil.cpp b/cpp/src/IcePatch2/ClientUtil.cpp index ede41b15399..364be6b8190 100644 --- a/cpp/src/IcePatch2/ClientUtil.cpp +++ b/cpp/src/IcePatch2/ClientUtil.cpp @@ -199,6 +199,9 @@ IcePatch2::Patcher::~Patcher() { } +namespace +{ + class PatcherGetFileInfoSeqCB : public GetFileInfoSeqCB { public: @@ -291,6 +294,8 @@ private: typedef IceUtil::Handle<AMIGetFileInfoSeq> AMIGetFileInfoSeqPtr; +} + bool IcePatch2::Patcher::prepare() { @@ -714,6 +719,9 @@ IcePatch2::Patcher::updateFiles(const FileInfoSeq& files) return result; } +namespace +{ + class AMIGetFileCompressed : public AMI_FileServer_getFileCompressed, public IceUtil::Monitor<IceUtil::Mutex> { public: @@ -774,6 +782,8 @@ private: typedef IceUtil::Handle<AMIGetFileCompressed> AMIGetFileCompressedPtr; +} + bool IcePatch2::Patcher::updateFilesInternal(const FileInfoSeq& files, const DecompressorPtr& decompressor) { diff --git a/cpp/src/IceUtil/UUID.cpp b/cpp/src/IceUtil/UUID.cpp index 917609685e3..0748670d2fa 100644 --- a/cpp/src/IceUtil/UUID.cpp +++ b/cpp/src/IceUtil/UUID.cpp @@ -56,6 +56,9 @@ PidInitializer pidInitializer; }; #endif +namespace +{ + // Helper char to hex functions // inline void halfByteToHex(unsigned char hb, char*& hexBuffer) @@ -79,6 +82,8 @@ inline void bytesToHex(unsigned char* bytes, size_t len, char*& hexBuffer) } } +} + string IceUtil::generateUUID() { |