summaryrefslogtreecommitdiff
path: root/indra/llmessage
diff options
context:
space:
mode:
authorAlexander Gavriliuk <alexandrgproductengine@lindenlab.com>2024-05-06 16:52:34 +0200
committerGuru <alexandrgproductengine@lindenlab.com>2024-05-07 10:18:51 +0200
commitf9473e8afcb624cc1b101195bf15943ec372b56f (patch)
tree27a9f85fa0ca8c9dd2138a5522e7a7970a063941 /indra/llmessage
parent15d4db0b5d52097de33ea036b8a1a4b7f5384e3f (diff)
secondlife/viewer#1333 BOOL to bool conversion leftovers: ternaries
Diffstat (limited to 'indra/llmessage')
-rw-r--r--indra/llmessage/llcachename.cpp8
-rw-r--r--indra/llmessage/llpumpio.cpp34
-rw-r--r--indra/llmessage/llregionflags.h9
-rw-r--r--indra/llmessage/lluseroperation.cpp2
-rw-r--r--indra/llmessage/message.cpp2
5 files changed, 32 insertions, 23 deletions
diff --git a/indra/llmessage/llcachename.cpp b/indra/llmessage/llcachename.cpp
index c90b6d86ad..5b4f9aded7 100644
--- a/indra/llmessage/llcachename.cpp
+++ b/indra/llmessage/llcachename.cpp
@@ -87,19 +87,19 @@ public:
LLUUID mID;
LLCacheNameSignal mSignal;
LLHost mHost;
-
+
PendingReply(const LLUUID& id, const LLHost& host)
: mID(id), mHost(host)
{
}
-
+
boost::signals2::connection setCallback(const LLCacheNameCallback& cb)
{
return mSignal.connect(cb);
}
-
+
void done() { mID.setNull(); }
- bool isDone() const { return mID.isNull() != false; }
+ bool isDone() const { return mID.isNull(); }
};
class ReplySender
diff --git a/indra/llmessage/llpumpio.cpp b/indra/llmessage/llpumpio.cpp
index 44720f0015..52e6be6f98 100644
--- a/indra/llmessage/llpumpio.cpp
+++ b/indra/llmessage/llpumpio.cpp
@@ -113,7 +113,7 @@ void ll_debug_poll_fd(const char* msg, const apr_pollfd_t* poll)
{
LL_DEBUGS() << "Poll -- " << (msg?msg:"") << ": no descriptor." << LL_ENDL;
}
-#endif
+#endif
}
/**
@@ -181,12 +181,13 @@ bool LLPumpIO::prime(apr_pool_t* pool)
{
cleanup();
initialize(pool);
- return ((pool == NULL) ? false : true);
+ return pool != nullptr;
}
bool LLPumpIO::addChain(const chain_t& chain, F32 timeout, bool has_curl_request)
{
- if(chain.empty()) return false;
+ if (chain.empty())
+ return false;
LLChainInfo info;
info.mHasCurlRequest = has_curl_request;
@@ -218,12 +219,13 @@ bool LLPumpIO::addChain(
LLSD context,
F32 timeout)
{
-
// remember that if the caller is providing a full link
// description, we need to have that description matched to a
// particular buffer.
- if(!data) return false;
- if(links.empty()) return false;
+ if (!data)
+ return false;
+ if (links.empty())
+ return false;
#if LL_DEBUG_PIPE_TYPE_IN_PUMP
LL_DEBUGS() << "LLPumpIO::addChain() " << links[0].mPipe << " '"
@@ -243,10 +245,11 @@ bool LLPumpIO::addChain(
bool LLPumpIO::setTimeoutSeconds(F32 timeout)
{
// If no chain is running, return failure.
- if(mRunningChains.end() == mCurrentChain)
+ if (mRunningChains.end() == mCurrentChain)
{
return false;
}
+
(*mCurrentChain).setTimeoutSeconds(timeout);
return true;
}
@@ -254,7 +257,7 @@ bool LLPumpIO::setTimeoutSeconds(F32 timeout)
void LLPumpIO::adjustTimeoutSeconds(F32 delta)
{
// Ensure a chain is running
- if(mRunningChains.end() != mCurrentChain)
+ if (mRunningChains.end() != mCurrentChain)
{
(*mCurrentChain).adjustTimeoutSeconds(delta);
}
@@ -263,27 +266,27 @@ void LLPumpIO::adjustTimeoutSeconds(F32 delta)
static std::string events_2_string(apr_int16_t events)
{
std::ostringstream ostr;
- if(events & APR_POLLIN)
+ if (events & APR_POLLIN)
{
ostr << "read,";
}
- if(events & APR_POLLPRI)
+ if (events & APR_POLLPRI)
{
ostr << "priority,";
}
- if(events & APR_POLLOUT)
+ if (events & APR_POLLOUT)
{
ostr << "write,";
}
- if(events & APR_POLLERR)
+ if (events & APR_POLLERR)
{
ostr << "error,";
}
- if(events & APR_POLLHUP)
+ if (events & APR_POLLHUP)
{
ostr << "hangup,";
}
- if(events & APR_POLLNVAL)
+ if (events & APR_POLLNVAL)
{
ostr << "invalid,";
}
@@ -292,7 +295,8 @@ static std::string events_2_string(apr_int16_t events)
bool LLPumpIO::setConditional(LLIOPipe* pipe, const apr_pollfd_t* poll)
{
- if(!pipe) return false;
+ if (!pipe)
+ return false;
ll_debug_poll_fd("Set conditional", poll);
LL_DEBUGS() << "Setting conditionals (" << (poll ? events_2_string(poll->reqevents) :"null")
diff --git a/indra/llmessage/llregionflags.h b/indra/llmessage/llregionflags.h
index 489765e0ac..ab2d127f6e 100644
--- a/indra/llmessage/llregionflags.h
+++ b/indra/llmessage/llregionflags.h
@@ -106,11 +106,16 @@ const U64 REGION_FLAGS_ESTATE_MASK = REGION_FLAGS_EXTERNALLY_VISIBLE
| REGION_FLAGS_DENY_ANONYMOUS
| REGION_FLAGS_DENY_AGEUNVERIFIED;
+inline bool is_flag_set(U64 flags, U64 flag)
+{
+ return (flags & flag) != 0;
+}
+
inline bool is_prelude( U64 flags )
{
// definition of prelude does not depend on fixed-sun
- return 0 == (flags & REGION_FLAGS_PRELUDE_UNSET)
- && 0 != (flags & REGION_FLAGS_PRELUDE_SET);
+ return !is_flag_set(flags, REGION_FLAGS_PRELUDE_UNSET) &&
+ is_flag_set(flags, REGION_FLAGS_PRELUDE_SET);
}
inline U64 set_prelude_flags(U64 flags)
diff --git a/indra/llmessage/lluseroperation.cpp b/indra/llmessage/lluseroperation.cpp
index 3e387d3d5e..6b0cc63686 100644
--- a/indra/llmessage/lluseroperation.cpp
+++ b/indra/llmessage/lluseroperation.cpp
@@ -138,7 +138,7 @@ bool LLUserOperationMgr::deleteOperation(LLUserOperation* op)
delete op;
op = NULL;
}
- return rv ? true : false;
+ return rv != 0;
}
void LLUserOperationMgr::deleteExpiredOperations()
diff --git a/indra/llmessage/message.cpp b/indra/llmessage/message.cpp
index 0d7810a659..272bf9b672 100644
--- a/indra/llmessage/message.cpp
+++ b/indra/llmessage/message.cpp
@@ -1947,7 +1947,7 @@ void LLMessageSystem::processUseCircuitCode(LLMessageSystem* msg,
// passed the circuit code and session id check, so we will go
// ahead and persist the ID associated.
LLCircuitData *cdp = msg->mCircuitInfo.findCircuit(msg->getSender());
- bool had_circuit_already = cdp ? true : false;
+ bool had_circuit_already = cdp != nullptr;
msg->enableCircuit(msg->getSender(), false);
cdp = msg->mCircuitInfo.findCircuit(msg->getSender());