Commit cd9f33d8 authored by Cinder's avatar Cinder
Browse files

Use literal true and false rather than convert ints

parent f1890753
......@@ -178,7 +178,7 @@ S32 LLQueuedThread::getPending()
// MAIN thread
void LLQueuedThread::waitOnPending()
{
while(1)
while(true)
{
update(0);
......@@ -407,7 +407,7 @@ S32 LLQueuedThread::processNextRequest()
// Get next request from pool
lockData();
while(1)
while(true)
{
req = nullptr;
if (mRequestQueue.empty())
......@@ -497,7 +497,7 @@ void LLQueuedThread::run()
startThread();
mStarted = true;
while (1)
while (true)
{
// this will block on the condition until runCondition() returns true, the thread is unpaused, or the thread leaves the RUNNING state.
checkPause();
......
......@@ -728,7 +728,7 @@ std::string ll_convert_string_to_utf8_string(const std::string& in)
long LLStringOps::sPacificTimeOffset = 0;
long LLStringOps::sLocalTimeOffset = 0;
bool LLStringOps::sPacificDaylightTime = 0;
bool LLStringOps::sPacificDaylightTime = false;
std::map<std::string, std::string> LLStringOps::datetimeToCodes;
std::vector<std::string> LLStringOps::sWeekDayList;
......
......@@ -773,7 +773,7 @@ void LLUUID::getCurrentTime(uuid_time_t *timestamp)
uuid_time_t time_now = {0,0};
while (1) {
while (true) {
getSystemTime(&time_now);
// if clock reading changed since last UUID generated
......
......@@ -1979,7 +1979,7 @@ S32 LLImageFormatted::calcDiscardLevelBytes(S32 bytes)
{
llassert(bytes >= 0);
S32 discard_level = 0;
while (1)
while (true)
{
S32 bytes_needed = calcDataSize(discard_level); // virtual
if (bytes_needed <= bytes)
......
......@@ -334,7 +334,7 @@ bool LLImageDXT::encodeDXT(const LLImageRaw* raw_image, F32 time, bool explicit_
break;
default:
LL_ERRS() << "LLImageDXT::encode: Unhandled channel number: " << ncomponents << LL_ENDL;
return 0;
return false;
}
S32 width = raw_image->getWidth();
......
......@@ -320,7 +320,7 @@ S32 LLImageJ2C::calcDiscardLevelBytes(S32 bytes)
{
return MAX_DISCARD_LEVEL;
}
while (1)
while (true)
{
S32 bytes_needed = calcDataSize(discard_level);
// Use TextureReverseByteRange percent (see settings.xml) of the optimal size to qualify as correct rendering for the given discard level
......
......@@ -42,7 +42,7 @@ static F32 g3[B + B + 2][3];
static F32 g2[B + B + 2][2];
static F32 g1[B + B + 2];
bool LLPerlinNoise::sInitialized = 0;
bool LLPerlinNoise::sInitialized = false;
static void normalize2(F32 v[2])
{
......
......@@ -375,7 +375,7 @@ LLNameValue::LLNameValue(const char *data)
S32 length = 0;
// go to first non-whitespace character
while (1)
while (true)
{
if ( (*(data + character_count) == ' ')
||(*(data + character_count) == '\n')
......@@ -399,7 +399,7 @@ LLNameValue::LLNameValue(const char *data)
character_count += length;
// go to the next non-whitespace character
while (1)
while (true)
{
if ( (*(data + character_count) == ' ')
||(*(data + character_count) == '\n')
......@@ -423,7 +423,7 @@ LLNameValue::LLNameValue(const char *data)
character_count += length;
// go to the next non-whitespace character
while (1)
while (true)
{
if ( (*(data + character_count) == ' ')
||(*(data + character_count) == '\n')
......@@ -459,7 +459,7 @@ LLNameValue::LLNameValue(const char *data)
character_count += length;
// go to the next non-whitespace character
while (1)
while (true)
{
if ( (*(data + character_count) == ' ')
||(*(data + character_count) == '\n')
......@@ -501,7 +501,7 @@ LLNameValue::LLNameValue(const char *data)
character_count += length;
// seek to next non-whitespace characer
while (1)
while (true)
{
if ( (*(data + character_count) == ' ')
||(*(data + character_count) == '\n')
......
......@@ -365,7 +365,7 @@ void LLTransferManager::processTransferInfo(LLMessageSystem *msgp, void **)
// This is a lame cut and paste of code down below. If we change the logic down there,
// we HAVE to change the logic up here.
while (1)
while (true)
{
S32 packet_id = 0;
U8 tmp_data[MAX_PACKET_DATA_SIZE];
......
......@@ -284,7 +284,7 @@ bool LLPluginMessagePipe::pumpInput(F64 timeout)
// and use the timeout so we'll sleep if no data is available.
setSocketTimeout((apr_interval_time_t)(timeout * 1000000));
while(1)
while(true)
{
size = request_size;
......
......@@ -438,7 +438,7 @@ void LLPluginProcessChild::receiveMessageRaw(const std::string &message)
{
// Hang the plugin
LL_WARNS("Plugin") << "Plugin hang requested." << LL_ENDL;
while(1)
while(true)
{
// wheeeeeeeee......
}
......
......@@ -61,7 +61,7 @@ LLRenderTarget::LLRenderTarget() :
mFBO(0),
mPreviousFBO(nullptr),
mDepth(0),
mStencil(0),
mStencil(false),
mUseDepth(false),
mRenderDepth(false),
mUsage(LLTexUnit::TT_TEXTURE)
......
......@@ -2868,7 +2868,7 @@ LLMenuItemGL* LLMenuGL::highlightNextItem(LLMenuItemGL* cur_item, BOOL skip_disa
}
}
while(1)
while(true)
{
// skip separators and disabled/invisible items
if ((*next_item_iter)->getEnabled() && (*next_item_iter)->getVisible() && !dynamic_cast<LLMenuItemSeparatorGL*>(*next_item_iter))
......@@ -2962,7 +2962,7 @@ LLMenuItemGL* LLMenuGL::highlightPrevItem(LLMenuItemGL* cur_item, BOOL skip_disa
}
}
while(1)
while(true)
{
// skip separators and disabled/invisible items
if ((*prev_item_iter)->getEnabled() && (*prev_item_iter)->getVisible() && (*prev_item_iter)->getName() != SEPARATOR_NAME)
......@@ -3379,7 +3379,7 @@ BOOL LLMenuBarGL::handleAcceleratorKey(KEY key, MASK mask)
BOOL LLMenuBarGL::handleKeyHere(KEY key, MASK mask)
{
static LLUICachedControl<bool> use_altkey_for_menus ("UseAltKeyForMenus", 0);
static LLUICachedControl<bool> use_altkey_for_menus ("UseAltKeyForMenus", false);
if(key == KEY_ALT && !gKeyboard->getKeyRepeated(key) && use_altkey_for_menus)
{
mAltKeyTrigger = TRUE;
......
......@@ -2067,7 +2067,7 @@ U32 LLXMLNode::getStringValue(U32 expected_length, std::string *array)
std::string::size_type n = 0;
std::string::size_type m = 0;
while(1)
while(true)
{
if (num_returned_strings >= expected_length)
{
......@@ -3219,14 +3219,14 @@ std::string LLXMLNode::getTextContents() const
{
// Case 1: node has quoted text
S32 num_lines = 0;
while(1)
while(true)
{
// mContents[n] == '"'
++n;
std::string::size_type t = n;
std::string::size_type m = 0;
// fix-up escaped characters
while(1)
while(true)
{
m = contents.find_first_of("\\\"", t); // find first \ or "
if ((m == std::string::npos) || (contents[m] == '\"'))
......
......@@ -454,14 +454,14 @@ std::string LLXmlTreeNode::getTextContents()
{
// Case 2: node has quoted text
S32 num_lines = 0;
while(1)
while(true)
{
// mContents[n] == '"'
++n;
std::string::size_type t = n;
std::string::size_type m = 0;
// fix-up escaped characters
while(1)
while(true)
{
m = mContents.find_first_of("\\\"", t); // find first \ or "
if ((m == std::string::npos) || (mContents[m] == '\"'))
......
......@@ -2490,7 +2490,7 @@ void LLAgent::setStartPositionSuccess(const LLSD &result)
error = false;
} while (0);
} while (false);
if (error)
{
......
......@@ -1016,7 +1016,7 @@ bool LLAppViewer::init()
std::ostringstream msg;
msg << LLTrans::getString("MBUnableToAccessFile");
OSMessageBox(msg.str(),LLStringUtil::null,OSMB_OK);
return 1;
return true;
}
LL_INFOS("InitInfo") << "Cache initialization is done." << LL_ENDL ;
......@@ -1067,7 +1067,7 @@ bool LLAppViewer::init()
LLNotifications::instance().getGlobalString("UnsupportedGLRequirements"),
LLStringUtil::null,
OSMB_OK);
return 0;
return false;
}
// Without SSE2 support we will crash almost immediately, warn here.
......@@ -1079,7 +1079,7 @@ bool LLAppViewer::init()
LLNotifications::instance().getGlobalString("UnsupportedCPUSSE2"),
LLStringUtil::null,
OSMB_OK);
return 0;
return false;
}
// alert the user if they are using unsupported hardware
......@@ -1651,7 +1651,7 @@ S32 LLAppViewer::updateTextureThreads(F32 max_time)
void LLAppViewer::flushVFSIO()
{
while (1)
while (true)
{
S32 pending = LLVFSThread::updateClass(0);
pending += LLLFSThread::updateClass(0);
......@@ -1966,7 +1966,7 @@ bool LLAppViewer::cleanup()
LLTimer idleTimer;
idleTimer.reset();
const F64 max_idle_time = 5.f; // 5 seconds
while(1)
while(true)
{
S32 pending = 0;
pending += LLAppViewer::getTextureCache()->update(1); // unpauses the worker thread
......
......@@ -182,7 +182,7 @@ void LLDayCycleManager::loadPresets(const std::string& dir)
{
LLDirIterator dir_iter(dir, "*.xml");
while (1)
while (true)
{
std::string file;
if (!dir_iter.next(file)) break; // no more files
......
......@@ -345,7 +345,7 @@ BOOL LLFilePicker::getMultipleOpenFiles(ELoadFilter filter)
mLocked = true;
WCHAR* tptrw = mFilesW;
std::string dirname;
while(1)
while(true)
{
if (*tptrw == 0 && *(tptrw+1) == 0) // double '\0'
break;
......
......@@ -67,7 +67,7 @@ void LLImageFiltersManager::loadFiltersFromDir(const std::string& dir)
mFiltersList.clear();
LLDirIterator dir_iter(dir, "*.xml");
while (1)
while (true)
{
std::string file_name;
if (!dir_iter.next(file_name))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment