diff --git a/indra/llcharacter/llbvhloader.cpp b/indra/llcharacter/llbvhloader.cpp index 841737208c164ec1cb22197f93523c056578b6a4..ef3f6b70df948b10093b06b767730c8d63391d3c 100644 --- a/indra/llcharacter/llbvhloader.cpp +++ b/indra/llcharacter/llbvhloader.cpp @@ -611,7 +611,7 @@ ELoadStatus LLBVHLoader::loadBVHFile(const char *buffer, char* error_text, S32 & //---------------------------------------------------------------- // consume } //---------------------------------------------------------------- - if ( strstr(line.c_str(), "}") ) + if ( strstr(line.c_str(), '}') ) { if (parent_joints.size() > 0) { @@ -719,7 +719,7 @@ ELoadStatus LLBVHLoader::loadBVHFile(const char *buffer, char* error_text, S32 & //---------------------------------------------------------------- // it must be { //---------------------------------------------------------------- - if ( !strstr(line.c_str(), "{") ) + if ( !strstr(line.c_str(), '{') ) { strncpy(error_text, line.c_str(), 127); /*Flawfinder: ignore*/ return E_ST_NO_OFFSET; diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index e0b48e37e38bd4cd36e7ce510c88e24963c8054d..97cb50b3e41407b63838691c1d66fc9408e04cbe 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -1111,7 +1111,7 @@ namespace LLError return; } - if(strlen(out->str().c_str()) < 128) + if(out->str().size() < 128) { strcpy(message, out->str().c_str()); } diff --git a/indra/llcorehttp/llhttpconstants.cpp b/indra/llcorehttp/llhttpconstants.cpp index 5e04cdff9c22f27421b299a28af73e4c28a3d157..f5417963c2935d4fd36db96b5f456ab06f408dfa 100644 --- a/indra/llcorehttp/llhttpconstants.cpp +++ b/indra/llcorehttp/llhttpconstants.cpp @@ -197,7 +197,7 @@ std::string get_base_cap_url(std::string url) // Maybe OpenSim? Just cut off the query string and last /. else { - size_t query_pos = url.find_first_of("\?"); + size_t query_pos = url.find_first_of('\?'); if(query_pos != std::string::npos) { diff --git a/indra/llplugin/llplugincookiestore.cpp b/indra/llplugin/llplugincookiestore.cpp index b9a82b702b1421cc68adf91e6ddecea3a4cc4770..0d4ee136f8cf0c12cd28ca1a2a3969eb82319351 100644 --- a/indra/llplugin/llplugincookiestore.cpp +++ b/indra/llplugin/llplugincookiestore.cpp @@ -136,7 +136,7 @@ bool LLPluginCookieStore::Cookie::parse(const std::string &host) } // the name and value are separated by the first equals sign - std::string::size_type name_value_sep = mCookie.find_first_of("=", name_start); + std::string::size_type name_value_sep = mCookie.find_first_of('=', name_start); if(name_value_sep == std::string::npos || name_value_sep > field_end) { // No separator found, so this is a field without an = @@ -272,7 +272,7 @@ bool LLPluginCookieStore::Cookie::parse(const std::string &host) } // Figure out whether this cookie ended with a ";" or not... - std::string::size_type last_char = mCookie.find_last_not_of(" "); + std::string::size_type last_char = mCookie.find_last_not_of(' '); if((last_char != std::string::npos) && (mCookie[last_char] != ';')) { mCookie += ";"; @@ -290,7 +290,7 @@ bool LLPluginCookieStore::Cookie::parse(const std::string &host) if(mPathEnd <= mPathStart) { // Figure out whether this cookie ended with a ";" or not... - std::string::size_type last_char = mCookie.find_last_not_of(" "); + std::string::size_type last_char = mCookie.find_last_not_of(' '); if((last_char != std::string::npos) && (mCookie[last_char] != ';')) { mCookie += ";"; diff --git a/indra/llprimitive/llmodelloader.cpp b/indra/llprimitive/llmodelloader.cpp index bf450143982192dc7ec9cbde196eae3ba3a36386..5be1e2d0b402d2d878872683393167f6261b68a8 100644 --- a/indra/llprimitive/llmodelloader.cpp +++ b/indra/llprimitive/llmodelloader.cpp @@ -155,7 +155,7 @@ bool LLModelLoader::getSLMFilename(const std::string& model_filename, std::strin { slm_filename = model_filename; - std::string::size_type i = model_filename.rfind("."); + std::string::size_type i = model_filename.rfind('.'); if (i != std::string::npos) { slm_filename.replace(i, model_filename.size()-1, ".slm"); diff --git a/indra/llprimitive/lltextureentry.cpp b/indra/llprimitive/lltextureentry.cpp index da0d94b0caaade2d61fa60d023f2c7f39d4b9455..b15fae66d4446da50126a38b6d13f0f83fd702a0 100644 --- a/indra/llprimitive/lltextureentry.cpp +++ b/indra/llprimitive/lltextureentry.cpp @@ -643,7 +643,7 @@ U32 LLTextureEntry::getVersionFromMediaVersionString(const std::string &version_ size_t found = version_string.find(MEDIA_VERSION_STRING_PREFIX); if (found != std::string::npos) { - found = version_string.find_first_of("/", found); + found = version_string.find_first_of('/', found); std::string v = version_string.substr(MEDIA_VERSION_STRING_PREFIX.length(), found); version = strtoul(v.c_str(),NULL,10); } @@ -660,7 +660,7 @@ LLUUID LLTextureEntry::getAgentIDFromMediaVersionString(const std::string &versi size_t found = version_string.find(MEDIA_VERSION_STRING_PREFIX); if (found != std::string::npos) { - found = version_string.find_first_of("/", found); + found = version_string.find_first_of('/', found); if (found != std::string::npos) { std::string v = version_string.substr(found + 1); diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp index cee483d43e3cdc6a64d8706630230b8fab0ce58b..f8d2008549670d5a5d142fc0ded98d704a776537 100644 --- a/indra/llui/llurlregistry.cpp +++ b/indra/llui/llurlregistry.cpp @@ -159,7 +159,7 @@ static bool stringHasUrl(const std::string &text) text.find(".com") != std::string::npos || text.find("<nolink>") != std::string::npos || text.find("<icon") != std::string::npos || - text.find("@") != std::string::npos); + text.find('@') != std::string::npos); } // <alchemy> diff --git a/indra/llxml/llxmlnode.cpp b/indra/llxml/llxmlnode.cpp index a536e9f1cabfb9f755bcd7d51b9131403f1ccbc4..4c4e646b11041e6334f9364d888a074617dee4a1 100644 --- a/indra/llxml/llxmlnode.cpp +++ b/indra/llxml/llxmlnode.cpp @@ -3243,7 +3243,7 @@ std::string LLXMLNode::getTextContents() const // mContents[m] == '"' num_lines++; msg += contents.substr(n,m-n) + "\n"; - n = contents.find_first_of("\"", m+1); + n = contents.find_first_of('\"', m+1); if (n == std::string::npos) { if (num_lines == 1) diff --git a/indra/llxml/llxmltree.cpp b/indra/llxml/llxmltree.cpp index 7a0f36f2653199c3af196a0d551030f7111fd82a..2e2fa285eb56fa169d4ed6a2b6e5fb862ab061ee 100644 --- a/indra/llxml/llxmltree.cpp +++ b/indra/llxml/llxmltree.cpp @@ -478,7 +478,7 @@ std::string LLXmlTreeNode::getTextContents() // mContents[m] == '"' num_lines++; msg += mContents.substr(n,m-n) + "\n"; - n = mContents.find_first_of("\"", m+1); + n = mContents.find_first_of('\"', m+1); if (n == std::string::npos) { if (num_lines == 1) diff --git a/indra/newview/llaoengine.cpp b/indra/newview/llaoengine.cpp index bd312ac884d7b542c49d7f3338bc4de369395d75..6b1314d4d5b5454e9bfaf7dfcb46f209f8ba68cf 100644 --- a/indra/newview/llaoengine.cpp +++ b/indra/newview/llaoengine.cpp @@ -1328,7 +1328,7 @@ void LLAOEngine::saveSet(const LLAOSet* set) bool LLAOEngine::renameSet(LLAOSet* set, const std::string& name) { - if (name.empty() || name.find(":") != std::string::npos) + if (name.empty() || name.find(':') != std::string::npos) { return false; } @@ -1693,7 +1693,7 @@ void LLAOEngine::parseNotecard(const char* buffer) if (line.empty() || line[0] == '#') continue; - if (line.find("[") != 0) + if (line.find('[') != 0) { LLSD args; args["LINE"] = (S32)index; @@ -1701,14 +1701,14 @@ void LLAOEngine::parseNotecard(const char* buffer) continue; } - if (line.find("]") == std::string::npos) + if (line.find(']') == std::string::npos) { LLSD args; args["LINE"] = (S32)index; LLNotificationsUtil::add("AOImportNoValidDelimiter", args); continue; } - U32 endTag = line.find("]"); + U32 endTag = line.find(']'); std::string stateName = line.substr(1, endTag - 1); LLStringUtil::trim(stateName); diff --git a/indra/newview/lleasymessagereader.cpp b/indra/newview/lleasymessagereader.cpp index 11c6ffa3f2d2de4ee705e2f084082e90f9b3dc87..f7680ff6ca59e10aa354b9a075a205466db98dcf 100644 --- a/indra/newview/lleasymessagereader.cpp +++ b/indra/newview/lleasymessagereader.cpp @@ -216,7 +216,7 @@ std::string LLEasyMessageLogEntry::getFull(BOOL beautify, BOOL show_header) if(!content_type.empty()) { - std::string parsed_content_type = content_type.substr(0, content_type.find_first_of(";")); + std::string parsed_content_type = content_type.substr(0, content_type.find_first_of(';')); boost::algorithm::trim(parsed_content_type); // trim excess data boost::algorithm::to_lower(parsed_content_type); // convert to lowercase if(parsed_content_type == "application/llsd+xml" || parsed_content_type == "application/xml") diff --git a/indra/newview/lleasymessagesender.cpp b/indra/newview/lleasymessagesender.cpp index 753359ed32bf6ed5323cf285bad24df45cf91979..f08afd10022c2c75b1f847077a91bf9e80b738dd 100644 --- a/indra/newview/lleasymessagesender.cpp +++ b/indra/newview/lleasymessagesender.cpp @@ -132,7 +132,7 @@ bool LLEasyMessageSender::sendLLUDPMessage(const LLHost& region_host, const std: return false; } - int eqpos = line.find("="); + int eqpos = line.find('='); if(eqpos == line.npos) { LLNotificationsUtil::add("GenericAlert", LLSD().with("MESSAGE", "Missing an equal sign")); diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp index a455c8e6d93ad7a3b650570908d221ee7142b643..c41df53031640a915d3ce28e0697480c37f28bab 100644 --- a/indra/newview/llfloatergodtools.cpp +++ b/indra/newview/llfloatergodtools.cpp @@ -1279,7 +1279,7 @@ void LLPanelRequestTools::onClickRequest() if(dest == SELECTION) { std::string req =getChild<LLUICtrl>("request")->getValue(); - req = req.substr(0, req.find_first_of(" ")); + req = req.substr(0, req.find_first_of(' ')); std::string param = getChild<LLUICtrl>("parameter")->getValue(); LLSelectMgr::getInstance()->sendGodlikeRequest(req, param); } @@ -1330,7 +1330,7 @@ void LLPanelRequestTools::sendRequest(const LLHost& host) } else { - req = req.substr(0, req.find_first_of(" ")); + req = req.substr(0, req.find_first_of(' ')); sendRequest(req, getChild<LLUICtrl>("parameter")->getValue().asString(), host); } } diff --git a/indra/newview/llfloatermessagelog.cpp b/indra/newview/llfloatermessagelog.cpp index 3a9ed5df149ba3f4cce29f9ec2c1756b1e6d77f0..f3b2f28eb3af43eb725ba853a5f43c6fe159a818 100644 --- a/indra/newview/llfloatermessagelog.cpp +++ b/indra/newview/llfloatermessagelog.cpp @@ -63,7 +63,7 @@ void LLMessageLogFilter::set(const std::string& filter) { LLStringUtil::toLower(token); - BOOL negative = token.find("!") == 0; + BOOL negative = token.find('!') == 0; if(negative) { token = token.substr(1); diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index 154788c74477a9cedf35c7ce8b0fe94421ff191f..ab82ecd37169d0909553a6448c151a09638b2f68 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -511,7 +511,7 @@ BOOL LLFloaterUIPreview::postBuild() } if(strncmp("template",language_directory.c_str(),8) // if it's not the template directory or a hidden directory - && std::string::npos == language_directory.find(".")) + && std::string::npos == language_directory.find('.')) { if(!strncmp("en",language_directory.c_str(),5)) // remember if we've seen en, so we can make it default { @@ -989,7 +989,7 @@ void LLFloaterUIPreview::onClickEditFloater() if (!bin.empty()) { // surround command with double quotes for the case if the path contains spaces - if (bin.find("\"") == std::string::npos) + if (bin.find('\"') == std::string::npos) { bin = "\"" + bin + "\""; } diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp index 0a1a7a7bc0ef24953145b1314844a8299a749051..de52db3442fd35cbd487e73cd1ab42d6c1d6c34d 100644 --- a/indra/newview/llfloaterurlentry.cpp +++ b/indra/newview/llfloaterurlentry.cpp @@ -247,7 +247,7 @@ void LLFloaterURLEntry::getMediaTypeCoro(std::string url, LLHandle<LLFloater> pa if (resultHeaders.has(HTTP_IN_HEADER_CONTENT_TYPE)) { const std::string& mediaType = resultHeaders[HTTP_IN_HEADER_CONTENT_TYPE]; - std::string::size_type idx1 = mediaType.find_first_of(";"); + std::string::size_type idx1 = mediaType.find_first_of(';'); std::string mimeType = mediaType.substr(0, idx1); if (!mimeType.empty()) { diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 9a4571d970dfad45d6a025a73c88bb6956a3de05..83ff51c741cc6b31ab821fe313beaf7a7ecc70a9 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -627,7 +627,7 @@ void LLIMModel::LLIMSession::onAdHocNameCache(const LLAvatarName& av_name) if (!av_name.isValidName()) { - size_t separator_index = mName.rfind(" "); + size_t separator_index = mName.rfind(' '); std::string name = mName.substr(0, separator_index); ++separator_index; std::string conference_word = mName.substr(separator_index, mName.length()); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 942b7935d96c0c85a9f6417db6bb1fe073a95bde..55a43259c89cd6335196e232d6950303649b016c 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3247,7 +3247,7 @@ void LLFolderBridge::gatherMessage(std::string& message, S32 depth, LLError::ELe return; } // Take the leading spaces out... - std::string::size_type start = message.find_first_not_of(" "); + std::string::size_type start = message.find_first_not_of(' '); // Append the message mMessage += message.substr(start, message.length() - start); } diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index f17465a23219b53cb1034b313eec1e474143b669..713c76577e7d3aeccf200f0e28df2267e1d584a1 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -3168,7 +3168,7 @@ void apply_udp_blacklist(const std::string& csv) std::string::size_type comma = 0; do { - comma = csv.find(",", start); + comma = csv.find(',', start); if (comma == std::string::npos) { comma = csv.length(); diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp index 82bc8636e0d2fe4810ff21dcf5fc1c7209edb60c..ef75034e2f525b0d50ffffdc234815738710cd53 100644 --- a/indra/newview/lltranslate.cpp +++ b/indra/newview/lltranslate.cpp @@ -470,7 +470,7 @@ bool LLBingTranslationHandler::parseResponse( } // Sample response: <string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">Hola</string> - size_t begin = body.find(">"); + size_t begin = body.find('>'); if (begin == std::string::npos || begin >= (body.size() - 1)) { begin = 0; diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index e159b18f9692b749da83af4b3e2ee027a7f19d29..0ea68be55350cba166014d0a587b9a89f995e203 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1206,11 +1206,11 @@ LLSD LLViewerMedia::getHeaders() // static bool LLViewerMedia::parseRawCookie(const std::string raw_cookie, std::string& name, std::string& value, std::string& path, bool& httponly, bool& secure) { - std::size_t name_pos = raw_cookie.find_first_of("="); + std::size_t name_pos = raw_cookie.find_first_of('='); if (name_pos != std::string::npos) { name = raw_cookie.substr(0, name_pos); - std::size_t value_pos = raw_cookie.find_first_of(";", name_pos); + std::size_t value_pos = raw_cookie.find_first_of(';', name_pos); if (value_pos != std::string::npos) { value = raw_cookie.substr(name_pos + 1, value_pos - name_pos - 1); @@ -1360,7 +1360,7 @@ void LLViewerMedia::getOpenIDCookieCoro(std::string url) LLViewerMedia::getCookieStore()->setCookiesFromHost(cookie, hostAuth); // Set cookie for snapshot publishing. - std::string authCookie = cookie.substr(0, cookie.find(";")); // strip path + std::string authCookie = cookie.substr(0, cookie.find(';')); // strip path LLWebProfile::setAuthCookie(authCookie); } @@ -2715,7 +2715,7 @@ void LLViewerMediaImpl::mimeDiscoveryCoro(std::string url) const std::string& mediaType = resultHeaders[HTTP_IN_HEADER_CONTENT_TYPE].asStringRef(); - std::string::size_type idx1 = mediaType.find_first_of(";"); + std::string::size_type idx1 = mediaType.find_first_of(';'); std::string mimeType = mediaType.substr(0, idx1); // We now no longer need to check the error code returned from the probe. diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 788e91023c80db671e29032f9cd91ace7a42200d..44359e5db8bf448a92158f42543c0b593c13773e 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -6603,7 +6603,7 @@ class LLPromptShowURL : public view_listener_t bool handleEvent(const LLSD& userdata) { std::string param = userdata.asString(); - std::string::size_type offset = param.find(","); + std::string::size_type offset = param.find(','); if (offset != param.npos) { std::string alert = param.substr(0, offset); @@ -6643,7 +6643,7 @@ class LLPromptShowFile : public view_listener_t bool handleEvent(const LLSD& userdata) { std::string param = userdata.asString(); - std::string::size_type offset = param.find(","); + std::string::size_type offset = param.find(','); if (offset != param.npos) { std::string alert = param.substr(0, offset); diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp index ef9ee6b334ee128cff0b4c65c6a72e3eff61c784..2e235cdd8a60ff6bd2da020832952a217f28b2df 100644 --- a/indra/newview/llviewernetwork.cpp +++ b/indra/newview/llviewernetwork.cpp @@ -455,7 +455,7 @@ void LLGridManager::addRemoteGrid(const std::string& login_uri, const EAddGridTy } // Trim any ending slash - size_t slash_pos = grid.find_last_of("/"); + size_t slash_pos = grid.find_last_of('/'); if (grid.length() - 1 == slash_pos) { grid.erase(slash_pos); diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 883f3b7965ae918caf328a9520709f94549f1202..becd26edda1720cf2ed2f58ead8f32323e3c109e 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -669,7 +669,7 @@ void LLViewerObject::setNameValueList(const std::string& name_value_list) std::string::size_type start = 0; while (start < length) { - std::string::size_type end = name_value_list.find_first_of("\n", start); + std::string::size_type end = name_value_list.find_first_of('\n', start); if (end == std::string::npos) end = length; if (end > start) { diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 1f3ca31bd81c79b736efb03d0c7f1a9333b558ac..681a5e9cc35d7bd578c94004971d22a4c66d1e26 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1484,11 +1484,11 @@ BOOL LLViewerFetchedTexture::createTexture(S32 usename/*= 0*/) size_t length = comment.length(); while (position < length) { - std::size_t equals_position = comment.find("=", position); + std::size_t equals_position = comment.find('=', position); if (equals_position != std::string::npos) { S8 type = comment.at(equals_position - 1); - position = comment.find("&", position); + position = comment.find('&', position); if (position != std::string::npos) { mComment[type] = comment.substr(equals_position + 1, position - (equals_position + 1)); diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 12b8c8cb9253cf550ae86de92a3699381c50cd7b..c8acb8650fe468371471622ab6acc55c3c4eb9bf 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -4598,7 +4598,7 @@ std::string LLVivoxVoiceClient::nameFromsipURI(const std::string &uri) std::string::size_type sipOffset, atOffset; sipOffset = uri.find("sip:"); - atOffset = uri.find("@"); + atOffset = uri.find('@'); if((sipOffset != std::string::npos) && (atOffset != std::string::npos)) { result = uri.substr(sipOffset + 4, atOffset - (sipOffset + 4));