diff options
author | Matthew Newhook <matthew@zeroc.com> | 2008-03-18 01:37:51 -0800 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2008-03-18 01:37:51 -0800 |
commit | aa0fcb15afd952144967d873bfc7b86d93973192 (patch) | |
tree | e657bb26128e8b1ba27353504bdbe7d2b4e3da98 /cpp/src | |
parent | Got rid of redundant #ifdef. (Bug 2429.) (diff) | |
download | ice-aa0fcb15afd952144967d873bfc7b86d93973192.tar.bz2 ice-aa0fcb15afd952144967d873bfc7b86d93973192.tar.xz ice-aa0fcb15afd952144967d873bfc7b86d93973192.zip |
http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=2719
Squashed commit of the following:
commit 5ff1fac3e73ef4fb3ac96a692812a849ff585ebc
Author: Matthew Newhook <matthew@zeroc.com>
Date: Tue Mar 18 01:27:20 2008 -0800
Fixed the various && || warnings from gcc.
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Ice/Outgoing.cpp | 2 | ||||
-rw-r--r-- | cpp/src/Ice/Reference.cpp | 4 | ||||
-rw-r--r-- | cpp/src/IceGrid/Allocatable.cpp | 4 | ||||
-rw-r--r-- | cpp/src/IceGrid/DescriptorHelper.cpp | 2 | ||||
-rw-r--r-- | cpp/src/IceGrid/DescriptorParser.cpp | 8 | ||||
-rw-r--r-- | cpp/src/IceGrid/LocatorI.cpp | 4 | ||||
-rw-r--r-- | cpp/src/IceGrid/NodeI.cpp | 2 | ||||
-rw-r--r-- | cpp/src/IceGrid/ServerCache.cpp | 16 | ||||
-rw-r--r-- | cpp/src/IceGrid/ServerI.cpp | 13 | ||||
-rw-r--r-- | cpp/src/IceGrid/SessionServantManager.cpp | 2 | ||||
-rw-r--r-- | cpp/src/IcePatch2/FileServerI.cpp | 2 | ||||
-rw-r--r-- | cpp/src/IcePatch2/Util.cpp | 8 | ||||
-rw-r--r-- | cpp/src/IceStorm/NodeI.cpp | 2 | ||||
-rwxr-xr-x | cpp/src/slice2sl/Gen.cpp | 20 |
14 files changed, 46 insertions, 43 deletions
diff --git a/cpp/src/Ice/Outgoing.cpp b/cpp/src/Ice/Outgoing.cpp index 5ec98899cd7..bac66e87a06 100644 --- a/cpp/src/Ice/Outgoing.cpp +++ b/cpp/src/Ice/Outgoing.cpp @@ -557,7 +557,7 @@ void IceInternal::BatchOutgoing::invoke() { assert(_handler || _connection); - if(_handler && !_handler->flushBatchRequests(this) || _connection && !_connection->flushBatchRequests(this)) + if((_handler && !_handler->flushBatchRequests(this)) || (_connection && !_connection->flushBatchRequests(this))) { IceUtil::Monitor<IceUtil::Mutex>::Lock sync(_monitor); while(!_exception.get() && !_sent) diff --git a/cpp/src/Ice/Reference.cpp b/cpp/src/Ice/Reference.cpp index 464820b4ed1..d9dc1f197c4 100644 --- a/cpp/src/Ice/Reference.cpp +++ b/cpp/src/Ice/Reference.cpp @@ -297,7 +297,7 @@ IceInternal::Reference::operator==(const Reference& r) const return false; } - if(_overrideCompress != r._overrideCompress || _overrideCompress && _compress != r._compress) + if((_overrideCompress != r._overrideCompress) || (_overrideCompress && _compress != r._compress)) { return false; } @@ -1187,7 +1187,7 @@ IceInternal::RoutableReference::operator==(const Reference& r) const { return false; } - if(_overrideTimeout != rhs->_overrideTimeout || _overrideTimeout && _timeout != rhs->_timeout) + if((_overrideTimeout != rhs->_overrideTimeout) || (_overrideTimeout && _timeout != rhs->_timeout)) { return false; } diff --git a/cpp/src/IceGrid/Allocatable.cpp b/cpp/src/IceGrid/Allocatable.cpp index 54641f14e5b..e078564d5a5 100644 --- a/cpp/src/IceGrid/Allocatable.cpp +++ b/cpp/src/IceGrid/Allocatable.cpp @@ -147,7 +147,7 @@ AllocationRequest::AllocationRequest(const SessionIPtr& session) : } Allocatable::Allocatable(bool allocatable, const AllocatablePtr& parent) : - _allocatable(allocatable || parent && parent->isAllocatable()), + _allocatable(allocatable || (parent && parent->isAllocatable())), _count(0), _releasing(false) { @@ -277,7 +277,7 @@ Allocatable::release(const SessionIPtr& session, bool fromRelease) // there's no request, just notify the allocatable that it can // be allocated again. // - if(request && allocatable->allocate(request, true) || !request && allocatable->canTryAllocate()) + if((request && allocatable->allocate(request, true)) || (!request && allocatable->canTryAllocate())) { while(true) { diff --git a/cpp/src/IceGrid/DescriptorHelper.cpp b/cpp/src/IceGrid/DescriptorHelper.cpp index de5dafdf6f8..b9b81bb1736 100644 --- a/cpp/src/IceGrid/DescriptorHelper.cpp +++ b/cpp/src/IceGrid/DescriptorHelper.cpp @@ -2876,7 +2876,7 @@ ApplicationHelper::getDistributions(DistributionDescriptor& distribution, } } else if(!_instance.distrib.icepatch.empty() && - (server.empty() && n->second.hasServers() || n->second.hasServer(server))) + ((server.empty() && n->second.hasServers()) || n->second.hasServer(server))) { nodes.push_back(n->first); } diff --git a/cpp/src/IceGrid/DescriptorParser.cpp b/cpp/src/IceGrid/DescriptorParser.cpp index 96b6f923ffd..e13e145d801 100644 --- a/cpp/src/IceGrid/DescriptorParser.cpp +++ b/cpp/src/IceGrid/DescriptorParser.cpp @@ -220,7 +220,7 @@ DescriptorHandler::startElement(const string& name, const IceXML::Attributes& at } else if(name == "server") { - if(!_currentNode.get() && !_currentTemplate.get() || _currentServer.get()) + if((!_currentNode.get() && !_currentTemplate.get()) || _currentServer.get()) { error("the <server> element can only be a child of a <node> or <server-template> element"); } @@ -236,7 +236,7 @@ DescriptorHandler::startElement(const string& name, const IceXML::Attributes& at } else if(name == "icebox") { - if(!_currentNode.get() && !_currentTemplate.get() || _currentServer.get()) + if((!_currentNode.get() && !_currentTemplate.get()) || _currentServer.get()) { error("the <icebox> element can only be a child of a <node> or <server-template> element"); } @@ -268,7 +268,7 @@ DescriptorHandler::startElement(const string& name, const IceXML::Attributes& at } else if(name == "service") { - if(!_currentServer.get() && !_currentTemplate.get() || _currentService.get()) + if((!_currentServer.get() && !_currentTemplate.get()) || _currentService.get()) { error("the <service> element can only be a child of an <icebox> or <service-template> element"); } @@ -414,7 +414,7 @@ DescriptorHandler::startElement(const string& name, const IceXML::Attributes& at else if(name == "distrib") { if(!_currentApplication.get() || - (_currentNode.get() || _currentTemplate.get()) && !_currentServer.get() || + ((_currentNode.get() || _currentTemplate.get()) && !_currentServer.get()) || _currentServer.get() != _currentCommunicator) { error("the <distrib> element can only be a child of an <application>, <server> or <icebox> element"); diff --git a/cpp/src/IceGrid/LocatorI.cpp b/cpp/src/IceGrid/LocatorI.cpp index 3c01acbcd5b..bf910ba31d1 100644 --- a/cpp/src/IceGrid/LocatorI.cpp +++ b/cpp/src/IceGrid/LocatorI.cpp @@ -185,7 +185,7 @@ LocatorI::Request::Request(const Ice::AMD_Locator_findAdapterByIdPtr& amdCB, _count(count), _lastAdapter(_adapters.begin()) { - assert(_count == 0 && _adapters.empty() || _count > 0); + assert((_count == 0 && _adapters.empty()) || _count > 0); } void @@ -362,7 +362,7 @@ LocatorI::Request::sendResponse() // contact the adapters or because the replica group has // no members. // - assert(_exception.get() || _replicaGroup && _adapters.empty()); + assert(_exception.get() || (_replicaGroup && _adapters.empty())); if(_traceLevels->locator > 0) { diff --git a/cpp/src/IceGrid/NodeI.cpp b/cpp/src/IceGrid/NodeI.cpp index 63471ae03b4..4328a4aef85 100644 --- a/cpp/src/IceGrid/NodeI.cpp +++ b/cpp/src/IceGrid/NodeI.cpp @@ -890,7 +890,7 @@ NodeI::observerUpdateServer(const ServerDynamicInfo& info) { IceUtil::Mutex::Lock sync(_observerMutex); - if(info.state == Destroyed || info.state == Inactive && info.enabled) + if(info.state == Destroyed || (info.state == Inactive && info.enabled)) { _serversDynamicInfo.erase(info.id); } diff --git a/cpp/src/IceGrid/ServerCache.cpp b/cpp/src/IceGrid/ServerCache.cpp index 15acb483456..2b23d511c86 100644 --- a/cpp/src/IceGrid/ServerCache.cpp +++ b/cpp/src/IceGrid/ServerCache.cpp @@ -380,7 +380,7 @@ ServerEntry::getProxy(int& activationTimeout, int& deactivationTimeout, string& { Lock sync(*this); - if(_loaded.get() || _proxy && _synchronizing && !upToDate) // Synced or if not up to date is fine + if(_loaded.get() || (_proxy && _synchronizing && !upToDate)) // Synced or if not up to date is fine { assert(_loaded.get() || _load.get() || _destroy.get()); activationTimeout = _activationTimeout; @@ -401,7 +401,7 @@ ServerEntry::getProxy(int& activationTimeout, int& deactivationTimeout, string& { Lock sync(*this); - if(_loaded.get() || _proxy && _synchronizing && !upToDate) // Synced or if not up to date is fine + if(_loaded.get() || (_proxy && _synchronizing && !upToDate)) // Synced or if not up to date is fine { assert(_loaded.get() || _load.get() || _destroy.get()); activationTimeout = _activationTimeout; @@ -455,7 +455,7 @@ ServerEntry::getAdapter(int& activationTimeout, int& deactivationTimeout, const { Lock sync(*this); - if(_loaded.get() || _proxy && _synchronizing && !upToDate) // Synced or if not up to date is fine + if(_loaded.get() || (_proxy && _synchronizing && !upToDate)) // Synced or if not up to date is fine { AdapterPrxDict::const_iterator p = _adapters.find(id); if(p != _adapters.end()) @@ -483,7 +483,7 @@ ServerEntry::getAdapter(int& activationTimeout, int& deactivationTimeout, const { Lock sync(*this); - if(_loaded.get() || _proxy && _synchronizing && !upToDate) // Synced or if not up to date is fine + if(_loaded.get() || (_proxy && _synchronizing && !upToDate)) // Synced or if not up to date is fine { AdapterPrxDict::const_iterator p = _adapters.find(id); if(p != _adapters.end()) @@ -915,8 +915,8 @@ ServerEntry::allocatedNoSync(const SessionIPtr& session) { Lock sync(*this); if(!_updated || - _loaded.get() && _loaded->descriptor->activation != "session" || - _load.get() && _load->descriptor->activation != "session") + (_loaded.get() && _loaded->descriptor->activation != "session") || + (_load.get() && _load->descriptor->activation != "session")) { return; } @@ -1009,8 +1009,8 @@ ServerEntry::releasedNoSync(const SessionIPtr& session) { Lock sync(*this); if(!_updated || - _loaded.get() && _loaded->descriptor->activation != "session" || - _load.get() && _load->descriptor->activation != "session") + (_loaded.get() && _loaded->descriptor->activation != "session") || + (_load.get() && _load->descriptor->activation != "session")) { return; } diff --git a/cpp/src/IceGrid/ServerI.cpp b/cpp/src/IceGrid/ServerI.cpp index f0a6772379d..4dc1d241882 100644 --- a/cpp/src/IceGrid/ServerI.cpp +++ b/cpp/src/IceGrid/ServerI.cpp @@ -133,7 +133,7 @@ descriptorWithoutRevisionEqual(const InternalServerDescriptorPtr& lhs, const Int return false; } - if(!lhs->distrib && rhs->distrib || lhs->distrib && !rhs->distrib) + if((!lhs->distrib && rhs->distrib) || (lhs->distrib && !rhs->distrib)) { return false; } @@ -877,7 +877,7 @@ ServerI::isAdapterActivatable(const string& id) const } if(_desc->activation == "manual" || - _desc->activation == "session" && _desc->sessionId.empty()) + (_desc->activation == "session" && _desc->sessionId.empty())) { return false; } @@ -1030,7 +1030,8 @@ ServerI::load(const AMD_Node_loadServerPtr& amdCB, const InternalServerDescripto // if(_desc && (replicaName != "Master" || _desc->sessionId == desc->sessionId) && - (_desc->uuid == desc->uuid && _desc->revision == desc->revision || descriptorWithoutRevisionEqual(_desc, desc))) + ((_desc->uuid == desc->uuid && _desc->revision == desc->revision) || + descriptorWithoutRevisionEqual(_desc, desc))) { if(_desc->revision != desc->revision) { @@ -1241,7 +1242,7 @@ ServerI::disableOnFailure() // is always and the server wasn't active at the time of the // failure we disable the server. // - if(_disableOnFailure != 0 || _activation == Always && (_state == Activating || _state == WaitForActivation)) + if(_disableOnFailure != 0 || (_activation == Always && (_state == Activating || _state == WaitForActivation))) { _previousActivation = _activation; _activation = Disabled; @@ -1258,8 +1259,8 @@ ServerI::enableAfterFailure(bool force) } if(force || - _disableOnFailure > 0 && - (_failureTime + IceUtil::Time::seconds(_disableOnFailure) < IceUtil::Time::now(IceUtil::Time::Monotonic))) + (_disableOnFailure > 0 && + (_failureTime + IceUtil::Time::seconds(_disableOnFailure) < IceUtil::Time::now(IceUtil::Time::Monotonic)))) { _activation = _previousActivation; _failureTime = IceUtil::Time(); diff --git a/cpp/src/IceGrid/SessionServantManager.cpp b/cpp/src/IceGrid/SessionServantManager.cpp index e1a0c491879..d6b5469ffd1 100644 --- a/cpp/src/IceGrid/SessionServantManager.cpp +++ b/cpp/src/IceGrid/SessionServantManager.cpp @@ -49,7 +49,7 @@ SessionServantManager::locate(const Ice::Current& current, Ice::LocalObjectPtr&) else { map<Ice::Identity, ServantInfo>::const_iterator p = _servants.find(current.id); - if(p == _servants.end() || _checkConnection && p->second.connection != current.con) + if(p == _servants.end() || (_checkConnection && p->second.connection != current.con)) { return 0; } diff --git a/cpp/src/IcePatch2/FileServerI.cpp b/cpp/src/IcePatch2/FileServerI.cpp index 8cae21bcec1..49c6423df41 100644 --- a/cpp/src/IcePatch2/FileServerI.cpp +++ b/cpp/src/IcePatch2/FileServerI.cpp @@ -76,7 +76,7 @@ IcePatch2::FileServerI::getFileCompressed_async(const AMD_FileServer_getFileComp if(path == ".." || path.find("/../") != string::npos || - path.size() >= 3 && (path.substr(0, 3) == "../" || path.substr(path.size() - 3, 3) == "/..")) + (path.size() >= 3 && (path.substr(0, 3) == "../" || path.substr(path.size() - 3, 3) == "/.."))) { FileAccessException ex; ex.reason = "illegal `..' component in path `" + path + "'"; diff --git a/cpp/src/IcePatch2/Util.cpp b/cpp/src/IcePatch2/Util.cpp index 5b53c99c9c3..e6422df2a87 100644 --- a/cpp/src/IcePatch2/Util.cpp +++ b/cpp/src/IcePatch2/Util.cpp @@ -279,7 +279,7 @@ IcePatch2::simplify(const string& path) } if(result == "/." || - result.size() == 4 && isalpha(result[0]) && result[1] == ':' && result[2] == '/' && result[3] == '.') + (result.size() == 4 && isalpha(result[0]) && result[1] == ':' && result[2] == '/' && result[3] == '.')) { return result.substr(0, result.size() - 1); } @@ -289,7 +289,7 @@ IcePatch2::simplify(const string& path) result.erase(result.size() - 2, 2); } - if(result == "/" || result.size() == 3 && isalpha(result[0]) && result[1] == ':' && result[2] == '/') + if(result == "/" || (result.size() == 3 && isalpha(result[0]) && result[1] == ':' && result[2] == '/')) { return result; } @@ -346,7 +346,7 @@ IcePatch2::getSuffix(const string& pa) string::size_type dotPos = path.rfind('.'); string::size_type slashPos = path.rfind('/'); - if(dotPos == string::npos || slashPos != string::npos && slashPos > dotPos) + if(dotPos == string::npos || (slashPos != string::npos && slashPos > dotPos)) { return string(); } @@ -362,7 +362,7 @@ IcePatch2::getWithoutSuffix(const string& pa) string::size_type dotPos = path.rfind('.'); string::size_type slashPos = path.rfind('/'); - if(dotPos == string::npos || slashPos != string::npos && slashPos > dotPos) + if(dotPos == string::npos || (slashPos != string::npos && slashPos > dotPos)) { return path; } diff --git a/cpp/src/IceStorm/NodeI.cpp b/cpp/src/IceStorm/NodeI.cpp index fce38132225..b10f09203d3 100644 --- a/cpp/src/IceStorm/NodeI.cpp +++ b/cpp/src/IceStorm/NodeI.cpp @@ -536,7 +536,7 @@ NodeI::mergeContinue() // need a majority of the nodes to be active in order to start // running. unsigned int ingroup = static_cast<unsigned int>(tmpSet.size()); - if(_max != _nodes.size() && ingroup != _nodes.size() -1 || ingroup < _nodes.size()/2) + if((_max != _nodes.size() && ingroup != _nodes.size() -1) || ingroup < _nodes.size()/2) { if(_traceLevels->election > 0) { diff --git a/cpp/src/slice2sl/Gen.cpp b/cpp/src/slice2sl/Gen.cpp index 516034513dc..f9f3538e32b 100755 --- a/cpp/src/slice2sl/Gen.cpp +++ b/cpp/src/slice2sl/Gen.cpp @@ -1520,7 +1520,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) } _out << eb; - if(!base || base && !base->usesClasses()) + if(!base || !base->usesClasses()) { _out << sp << nl << "public override bool usesClasses__()"; _out << sb; @@ -3377,14 +3377,16 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p) string param = fixId(q->second); StructPtr st = StructPtr::dynamicCast(q->first); if(st) - if(isValueType(st)) - { - _out << nl << param << " = new " << typeToString(q->first) << "();"; - } - else - { - _out << nl << param << " = null;"; - } + { + if(isValueType(st)) + { + _out << nl << param << " = new " << typeToString(q->first) << "();"; + } + else + { + _out << nl << param << " = null;"; + } + } writeMarshalUnmarshalCode(_out, q->first, fixId(q->second), false, false, true); } if(ret) |