diff options
author | Alexander Gavriliuk <alexandrgproductengine@lindenlab.com> | 2024-05-06 16:52:34 +0200 |
---|---|---|
committer | Guru <alexandrgproductengine@lindenlab.com> | 2024-05-07 10:18:51 +0200 |
commit | f9473e8afcb624cc1b101195bf15943ec372b56f (patch) | |
tree | 27a9f85fa0ca8c9dd2138a5522e7a7970a063941 /indra/llcommon | |
parent | 15d4db0b5d52097de33ea036b8a1a4b7f5384e3f (diff) |
secondlife/viewer#1333 BOOL to bool conversion leftovers: ternaries
Diffstat (limited to 'indra/llcommon')
-rw-r--r-- | indra/llcommon/StackWalker.cpp | 2 | ||||
-rw-r--r-- | indra/llcommon/llapp.cpp | 2 | ||||
-rw-r--r-- | indra/llcommon/llmutex.cpp | 6 | ||||
-rw-r--r-- | indra/llcommon/llnametable.h | 2 | ||||
-rw-r--r-- | indra/llcommon/llqueuedthread.h | 2 | ||||
-rw-r--r-- | indra/llcommon/llregistry.h | 2 | ||||
-rw-r--r-- | indra/llcommon/llsdserialize.cpp | 2 | ||||
-rw-r--r-- | indra/llcommon/llstl.h | 2 | ||||
-rw-r--r-- | indra/llcommon/llstring.h | 2 | ||||
-rw-r--r-- | indra/llcommon/llthread.h | 8 | ||||
-rw-r--r-- | indra/llcommon/lltimer.cpp | 9 | ||||
-rw-r--r-- | indra/llcommon/lluuid.h | 2 | ||||
-rw-r--r-- | indra/llcommon/llworkerthread.cpp | 2 | ||||
-rw-r--r-- | indra/llcommon/llworkerthread.h | 2 |
14 files changed, 22 insertions, 23 deletions
diff --git a/indra/llcommon/StackWalker.cpp b/indra/llcommon/StackWalker.cpp index 4ecff4ee69..2c1bc47d0e 100644 --- a/indra/llcommon/StackWalker.cpp +++ b/indra/llcommon/StackWalker.cpp @@ -1256,7 +1256,7 @@ bool StackWalker::ShowCallstack(bool verbose, HANDLE hThread, const CONTEXT *con cleanup: if (pSym) free( pSym ); - if (bLastEntryCalled == false) + if (!bLastEntryCalled) this->OnCallstackEntry(lastEntry, csEntry); if (context == NULL) diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index 8275f80f75..2f41c039f2 100644 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -474,7 +474,7 @@ void LLApp::disableCrashlogger() // static bool LLApp::isCrashloggerDisabled() { - return (sDisableCrashlogger == true); + return sDisableCrashlogger; } // static diff --git a/indra/llcommon/llmutex.cpp b/indra/llcommon/llmutex.cpp index 1c025c286d..3cfdc8304e 100644 --- a/indra/llcommon/llmutex.cpp +++ b/indra/llcommon/llmutex.cpp @@ -57,7 +57,7 @@ void LLMutex::lock() #if MUTEX_DEBUG // Have to have the lock before we can access the debug info auto id = LLThread::currentID(); - if (mIsLocked[id] != false) + if (mIsLocked[id]) LL_ERRS() << "Already locked in Thread: " << id << LL_ENDL; mIsLocked[id] = true; #endif @@ -77,7 +77,7 @@ void LLMutex::unlock() #if MUTEX_DEBUG // Access the debug info while we have the lock auto id = LLThread::currentID(); - if (mIsLocked[id] != true) + if (!mIsLocked[id]) LL_ERRS() << "Not locked in Thread: " << id << LL_ENDL; mIsLocked[id] = false; #endif @@ -127,7 +127,7 @@ bool LLMutex::trylock() #if MUTEX_DEBUG // Have to have the lock before we can access the debug info auto id = LLThread::currentID(); - if (mIsLocked[id] != false) + if (mIsLocked[id]) LL_ERRS() << "Already locked in Thread: " << id << LL_ENDL; mIsLocked[id] = true; #endif diff --git a/indra/llcommon/llnametable.h b/indra/llcommon/llnametable.h index 4f11c595ed..ca4c56f630 100644 --- a/indra/llcommon/llnametable.h +++ b/indra/llcommon/llnametable.h @@ -64,7 +64,7 @@ public: bool checkName(const char *name) const { char *tablename = gStringTable.addString(name); - return mNameMap.count(tablename) ? true : false; + return mNameMap.find(tablename) != mNameMap.end(); } DATA resolveName(const std::string& name) const diff --git a/indra/llcommon/llqueuedthread.h b/indra/llcommon/llqueuedthread.h index eac4a3e2cb..70d87e7c04 100644 --- a/indra/llcommon/llqueuedthread.h +++ b/indra/llcommon/llqueuedthread.h @@ -144,7 +144,7 @@ public: void printQueueStats(); virtual size_t getPending(); - bool getThreaded() { return mThreaded ? true : false; } + bool getThreaded() { return mThreaded; } // Request accessors status_t getRequestStatus(handle_t handle); diff --git a/indra/llcommon/llregistry.h b/indra/llcommon/llregistry.h index e272d7a9b8..89d56373e1 100644 --- a/indra/llcommon/llregistry.h +++ b/indra/llcommon/llregistry.h @@ -60,7 +60,7 @@ public: bool add(ref_const_key_t key, ref_const_value_t value) { - if (mMap.insert(std::make_pair(key, value)).second == false) + if (!mMap.insert(std::make_pair(key, value)).second) { LL_WARNS() << "Tried to register " << key << " but it was already registered!" << LL_ENDL; return false; diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp index 76171f2dfd..756fd7c678 100644 --- a/indra/llcommon/llsdserialize.cpp +++ b/indra/llcommon/llsdserialize.cpp @@ -389,7 +389,7 @@ LLSDParser::~LLSDParser() S32 LLSDParser::parse(std::istream& istr, LLSD& data, llssize max_bytes, S32 max_depth) { - mCheckLimits = (LLSDSerialize::SIZE_UNLIMITED == max_bytes) ? false : true; + mCheckLimits = LLSDSerialize::SIZE_UNLIMITED != max_bytes; mMaxBytesLeft = max_bytes; return doParse(istr, data, max_depth); } diff --git a/indra/llcommon/llstl.h b/indra/llcommon/llstl.h index 25131291f9..e39769fe9d 100644 --- a/indra/llcommon/llstl.h +++ b/indra/llcommon/llstl.h @@ -532,7 +532,7 @@ bool before(const std::type_info* lhs, const std::type_info* rhs) return strcmp(lhs->name(), rhs->name()) < 0; #else // not Linux, or gcc 4.4+ // Just use before(), as we normally would - return lhs->before(*rhs) ? true : false; + return lhs->before(*rhs); #endif } diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index 300516c78d..a20a40e205 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -464,7 +464,7 @@ struct LLDictionaryLess public: bool operator()(const std::string& a, const std::string& b) const { - return (LLStringUtil::precedesDict(a, b) ? true : false); + return (LLStringUtil::precedesDict(a, b)); } }; diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index 1bcbefe9b2..cf2ae00cd7 100644 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -59,17 +59,17 @@ public: bool isQuitting() const { return (QUITTING == mStatus); } bool isStopped() const { return (STOPPED == mStatus) || (CRASHED == mStatus); } bool isCrashed() const { return (CRASHED == mStatus); } - + static id_t currentID(); // Return ID of current thread static void yield(); // Static because it can be called by the main thread, which doesn't have an LLThread data structure. - + public: // PAUSE / RESUME functionality. See source code for important usage notes. // Called from MAIN THREAD. void pause(); void unpause(); - bool isPaused() { return isStopped() || mPaused == true; } - + bool isPaused() { return isStopped() || mPaused; } + // Cause the thread to wake up and check its condition void wake(); diff --git a/indra/llcommon/lltimer.cpp b/indra/llcommon/lltimer.cpp index 42c4911ff1..b1ddfc952c 100644 --- a/indra/llcommon/lltimer.cpp +++ b/indra/llcommon/lltimer.cpp @@ -424,7 +424,7 @@ F32SecondsImplicit LLTimer::getElapsedTimeAndResetF32() /////////////////////////////////////////////////////////////////////////////// -void LLTimer::setTimerExpirySec(F32SecondsImplicit expiration) +void LLTimer::setTimerExpirySec(F32SecondsImplicit expiration) { mExpirationTicks = get_clock_count() + (U64)((F32)(expiration * get_timer_info().mClockFrequency.value())); @@ -441,7 +441,7 @@ F32SecondsImplicit LLTimer::getRemainingTimeF32() const } -bool LLTimer::checkExpirationAndReset(F32 expiration) +bool LLTimer::checkExpirationAndReset(F32 expiration) { U64 cur_ticks = get_clock_count(); if (cur_ticks < mExpirationTicks) @@ -455,10 +455,9 @@ bool LLTimer::checkExpirationAndReset(F32 expiration) } -bool LLTimer::hasExpired() const +bool LLTimer::hasExpired() const { - return (get_clock_count() >= mExpirationTicks) - ? true : false; + return get_clock_count() >= mExpirationTicks; } /////////////////////////////////////////////////////////////////////////////// diff --git a/indra/llcommon/lluuid.h b/indra/llcommon/lluuid.h index 9c306266e7..54fb5742a2 100644 --- a/indra/llcommon/lluuid.h +++ b/indra/llcommon/lluuid.h @@ -153,7 +153,7 @@ struct lluuid_less { bool operator()(const LLUUID& lhs, const LLUUID& rhs) const { - return (lhs < rhs) ? true : false; + return lhs < rhs; } }; diff --git a/indra/llcommon/llworkerthread.cpp b/indra/llcommon/llworkerthread.cpp index 06c74bdba0..231dbe4310 100644 --- a/indra/llcommon/llworkerthread.cpp +++ b/indra/llcommon/llworkerthread.cpp @@ -284,7 +284,7 @@ bool LLWorkerClass::yield() mWorkerThread->checkPause(); bool res; mMutex.lock(); - res = (getFlags() & WCF_ABORT_REQUESTED) ? true : false; + res = (getFlags() & WCF_ABORT_REQUESTED) != 0; mMutex.unlock(); return res; } diff --git a/indra/llcommon/llworkerthread.h b/indra/llcommon/llworkerthread.h index eb26c28d3d..a0fe30404d 100644 --- a/indra/llcommon/llworkerthread.h +++ b/indra/llcommon/llworkerthread.h @@ -178,7 +178,7 @@ private: void clearFlags(U32 flags) { mWorkFlags = mWorkFlags & ~flags; } U32 getFlags() { return mWorkFlags; } public: - bool getFlags(U32 flags) { return mWorkFlags & flags ? true : false; } + bool getFlags(U32 flags) { return (mWorkFlags & flags) != 0; } private: // pure virtuals |