diff --git a/indra/llaudio/llaudiodecodemgr.cpp b/indra/llaudio/llaudiodecodemgr.cpp index 6ab61689fd0532a8f67c65576ed2cd0c7bfcda94..f11d11f547e027140c14aae2fae263d677cf98ae 100644 --- a/indra/llaudio/llaudiodecodemgr.cpp +++ b/indra/llaudio/llaudiodecodemgr.cpp @@ -271,7 +271,7 @@ BOOL LLVorbisDecodeState::initDecode() mWAVBuffer.reserve(size_guess); mWAVBuffer.resize(WAV_HEADER_SIZE); } - catch (std::bad_alloc) + catch (const std::bad_alloc&) { LL_WARNS("AudioEngine") << "Out of memory when trying to alloc buffer: " << size_guess << LL_ENDL; delete mInFilep; diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp index 1ae7a6f4788deb33ecfc619047e8f6b01a2aa641..e1b13a1d05bc060a11e69ba641cb83ddc2b37670 100644 --- a/indra/llcommon/llsdserialize.cpp +++ b/indra/llcommon/llsdserialize.cpp @@ -2244,13 +2244,13 @@ LLUZipHelper::EZipRresult LLUZipHelper::unzip_llsd(LLSD& data, std::istream& is, istr.str(res_str); } #ifdef LL_WINDOWS - catch (std::length_error) + catch (const std::length_error&) { free(result); return ZR_SIZE_ERROR; } #endif - catch (std::bad_alloc) + catch (const std::bad_alloc&) { free(result); return ZR_MEM_ERROR; diff --git a/indra/llcorehttp/_httpservice.cpp b/indra/llcorehttp/_httpservice.cpp index 0b72b5318601f92834dadb93df0cfd968838576e..0b8d4dbb81748676173f8111fb4865ff9555a8b4 100644 --- a/indra/llcorehttp/_httpservice.cpp +++ b/indra/llcorehttp/_httpservice.cpp @@ -318,7 +318,7 @@ void HttpService::threadRun(LLCoreInt::HttpThread * thread) { LOG_UNHANDLED_EXCEPTION(""); } - catch (std::bad_alloc) + catch (const std::bad_alloc&) { LLMemory::logMemoryInfo(TRUE); diff --git a/indra/llcorehttp/bufferarray.cpp b/indra/llcorehttp/bufferarray.cpp index be534b3ce4f2fd67d11ef9158bf1f076e1565c8f..78a4cb947ba4375c3538108cea7e115a12d96e7d 100644 --- a/indra/llcorehttp/bufferarray.cpp +++ b/indra/llcorehttp/bufferarray.cpp @@ -147,7 +147,7 @@ size_t BufferArray::append(const void * src, size_t len) { block = Block::alloc(BLOCK_ALLOC_SIZE); } - catch (std::bad_alloc) + catch (const std::bad_alloc&) { LLMemory::logMemoryInfo(TRUE); diff --git a/indra/llimage/llimagejpeg.cpp b/indra/llimage/llimagejpeg.cpp index eaccd62462b2f73bf1285096f3c6160f0e72bfd0..eaa4bcb5850fa893c4f81fd0057a00b444515c33 100644 --- a/indra/llimage/llimagejpeg.cpp +++ b/indra/llimage/llimagejpeg.cpp @@ -315,7 +315,7 @@ bool LLImageJPEG::decode(LLImageRaw* raw_image, F32 decode_time) jpeg_destroy_decompress(&cinfo); } - catch (std::bad_alloc) + catch (const std::bad_alloc&) { setLastError( "Out of memory"); jpeg_destroy_decompress(&cinfo); diff --git a/indra/llimage/llpngwrapper.cpp b/indra/llimage/llpngwrapper.cpp index f298764cc0743a8a5856c741a7645673e920961f..1e51e7375e77e4e2b7c1083f8f0c44bd1da937e8 100644 --- a/indra/llimage/llpngwrapper.cpp +++ b/indra/llimage/llpngwrapper.cpp @@ -210,7 +210,7 @@ BOOL LLPngWrapper::readPng(U8* src, S32 dataSize, LLImageRaw* rawImage, ImageInf releaseResources(); return (FALSE); } - catch (std::bad_alloc) + catch (const std::bad_alloc&) { mErrorMessage = "LLPngWrapper"; releaseResources(); diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp index 4048b9a43d0fa13e8fa83c3d5f8ac4170ab3b05f..99b8e2c9bc414f041cee2348bd95b9387d6304df 100644 --- a/indra/llkdu/llimagej2ckdu.cpp +++ b/indra/llkdu/llimagej2ckdu.cpp @@ -483,7 +483,7 @@ bool LLImageJ2CKDU::initDecode(LLImageJ2C &base, LLImageRaw &raw_image, F32 deco base.setLastError(msg.what()); return false; } - catch (kdu_exception kdu_value) + catch (const kdu_exception& kdu_value) { // KDU internally throws kdu_exception. It's possible that such an // exception might leak out into our code. Catch kdu_exception @@ -592,7 +592,7 @@ bool LLImageJ2CKDU::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 deco cleanupCodeStream(); return true; // done } - catch (kdu_exception kdu_value) + catch (const kdu_exception& kdu_value) { // KDU internally throws kdu_exception. It's possible that such an // exception might leak out into our code. Catch kdu_exception @@ -795,7 +795,7 @@ bool LLImageJ2CKDU::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, co base.setLastError(msg.what()); return false; } - catch (kdu_exception kdu_value) + catch (const kdu_exception& kdu_value) { // KDU internally throws kdu_exception. It's possible that such an // exception might leak out into our code. Catch kdu_exception @@ -829,7 +829,7 @@ bool LLImageJ2CKDU::getMetadata(LLImageJ2C &base) base.setLastError(msg.what()); return false; } - catch (kdu_exception kdu_value) + catch (const kdu_exception& kdu_value) { // KDU internally throws kdu_exception. It's possible that such an // exception might leak out into our code. Catch kdu_exception diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 2ac1eb99ce7d250ebba085d4ca251bae0750931e..675c59d4d5e2d1bcb84d10fb689f8d22ebb1b61c 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -5288,7 +5288,7 @@ bool LLVolumeFace::cacheOptimize() triangle_data.resize(mNumIndices / 3); vertex_data.resize(mNumVertices); } - catch (std::bad_alloc) + catch (const std::bad_alloc&) { LL_WARNS("LLVOLUME") << "Resize failed" << LL_ENDL; return false; @@ -5442,7 +5442,7 @@ bool LLVolumeFace::cacheOptimize() { new_idx.resize(mNumVertices, -1); } - catch (std::bad_alloc) + catch (const std::bad_alloc&) { ll_aligned_free<64>(pos); ll_aligned_free_16(wght); diff --git a/indra/llmessage/llcorehttputil.cpp b/indra/llmessage/llcorehttputil.cpp index 24387fbffd7bf869175b098557e94594eaac696b..fdb441c6602a43113aa7ea5ade9a72fdeac895c8 100644 --- a/indra/llmessage/llcorehttputil.cpp +++ b/indra/llmessage/llcorehttputil.cpp @@ -597,7 +597,7 @@ LLSD HttpCoroJSONHandler::handleSuccess(LLCore::HttpResponse * response, LLCore: { bas >> jsonRoot; } - catch (std::runtime_error e) + catch (const std::runtime_error& e) { // deserialization failed. Record the reason and pass back an empty map for markup. status = LLCore::HttpStatus(499, std::string(e.what())); return result; @@ -625,7 +625,7 @@ LLSD HttpCoroJSONHandler::parseBody(LLCore::HttpResponse *response, bool &succes { bas >> jsonRoot; } - catch (std::runtime_error e) + catch (const std::runtime_error&) { success = false; return LLSD(); diff --git a/indra/llmessage/llhttpnode.cpp b/indra/llmessage/llhttpnode.cpp index 04b34a296c13c4961498a4f58f6dccdf014689f2..612c947a596b119c07e1c4f130d04a1c5b0bfc1a 100644 --- a/indra/llmessage/llhttpnode.cpp +++ b/indra/llmessage/llhttpnode.cpp @@ -125,7 +125,7 @@ void LLHTTPNode::get(LLHTTPNode::ResponsePtr response, const LLSD& context) cons { response->result(simpleGet()); } - catch (NotImplemented) + catch (const NotImplemented&) { response->methodNotAllowed(); } @@ -138,7 +138,7 @@ void LLHTTPNode::put(LLHTTPNode::ResponsePtr response, const LLSD& context, cons { response->result(simplePut(input)); } - catch (NotImplemented) + catch (const NotImplemented&) { response->methodNotAllowed(); } @@ -151,7 +151,7 @@ void LLHTTPNode::post(LLHTTPNode::ResponsePtr response, const LLSD& context, con { response->result(simplePost(input)); } - catch (NotImplemented) + catch (const NotImplemented&) { response->methodNotAllowed(); } @@ -164,7 +164,7 @@ void LLHTTPNode::del(LLHTTPNode::ResponsePtr response, const LLSD& context) cons { response->result(simpleDel(context)); } - catch (NotImplemented) + catch (const NotImplemented&) { response->methodNotAllowed(); } diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index 139f48fef8055db26607f81ebd4fa1f02338a563..36ad8b3da450be3c6dd90d5719300c0efb5cdea4 100644 --- a/indra/llprimitive/lldaeloader.cpp +++ b/indra/llprimitive/lldaeloader.cpp @@ -1121,9 +1121,9 @@ std::string LLDAELoader::preprocessDAE(std::string filename) next++; } } - catch (boost::regex_error &) + catch (const boost::regex_error& err) { - LL_INFOS() << "Regex error" << LL_ENDL; + LL_INFOS() << "Regex error: " << err.what() << LL_ENDL; } return buffer; diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp index b526c1df085bb585d9125ddd7057eebaff7c6dd6..3ffda3e44eea6bef610021ca30160a1b392896c9 100644 --- a/indra/llui/llurlregistry.cpp +++ b/indra/llui/llurlregistry.cpp @@ -118,7 +118,7 @@ static bool matchRegex(const char *text, boost::regex regex, U32 &start, U32 &en { found = boost::regex_search(text, result, regex); } - catch (std::runtime_error &) + catch (const std::runtime_error &) { return false; } diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp index 2076ce334e426a221ed4a48d2a2832466cf6b4e4..00bcb32253a38a0374251c34728a64dff644b2a1 100644 --- a/indra/llvfs/lldir.cpp +++ b/indra/llvfs/lldir.cpp @@ -217,7 +217,7 @@ U32 LLDir::deleteDirAndContents(const std::string& dir_name) } } } - catch (boost::filesystem::filesystem_error &er) + catch (const boost::filesystem::filesystem_error &er) { LL_WARNS() << "Failed to delete " << dir_name << " with error " << er.code().message() << LL_ENDL; } diff --git a/indra/llvfs/lldiriterator.cpp b/indra/llvfs/lldiriterator.cpp index 3eb64e69d9ab23df63242cbd236d15bd6eed6ddd..7f9fb85d62e06c76e23128c2b98632beeb54beb5 100644 --- a/indra/llvfs/lldiriterator.cpp +++ b/indra/llvfs/lldiriterator.cpp @@ -97,7 +97,7 @@ LLDirIterator::Impl::Impl(const std::string &dirname, const std::string &mask) { mFilterExp.assign(exp); } - catch (boost::regex_error& e) + catch (const boost::regex_error& e) { LL_WARNS() << "\"" << exp << "\" is not a valid regular expression: " << e.what() << LL_ENDL; diff --git a/indra/newview/llappcorehttp.cpp b/indra/newview/llappcorehttp.cpp index afa44149684eb718b8d4f055680a563a1e376075..36299c0f5446f23a43a5b37d74ebcff2e9379335 100644 --- a/indra/newview/llappcorehttp.cpp +++ b/indra/newview/llappcorehttp.cpp @@ -539,7 +539,7 @@ LLCore::HttpStatus LLAppCoreHttp::sslVerify(const std::string &url, // don't validate hostname. Let libcurl do it instead. That way, it'll handle redirects store->validate(VALIDATION_POLICY_SSL & (~VALIDATION_POLICY_HOSTNAME), chain, validation_params); } - catch (LLCertValidationTrustException &cert_exception) + catch (const LLCertValidationTrustException &cert_exception) { // this exception is is handled differently than the general cert // exceptions, as we allow the user to actually add the certificate @@ -555,7 +555,7 @@ LLCore::HttpStatus LLAppCoreHttp::sslVerify(const std::string &url, // We should probably have a more generic way of passing information // back to the error handlers. } - catch (LLCertException &cert_exception) + catch (const LLCertException &cert_exception) { result = LLCore::HttpStatus(LLCore::HttpStatus::EXT_CURL_EASY, CURLE_SSL_PEER_CERTIFICATE); result.setMessage(cert_exception.what()); diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 46434a582d330d50192240255e95f984f410d5f2..ce7414983d44d023fe1c0b802c246c50d2ee376c 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1146,7 +1146,7 @@ bool LLAppViewer::init() try { initializeSecHandler(); } - catch (LLProtectedDataException ex) + catch (const LLProtectedDataException&) { LLNotificationsUtil::add("CorruptedProtectedDataStore"); } @@ -1360,7 +1360,7 @@ bool LLAppViewer::frame() { LOG_UNHANDLED_EXCEPTION(""); } - catch (std::bad_alloc) + catch (const std::bad_alloc&) { LLMemory::logMemoryInfo(TRUE); LLFloaterMemLeak* mem_leak_instance = LLFloaterReg::findTypedInstance<LLFloaterMemLeak>("mem_leaking"); diff --git a/indra/newview/llcommandlineparser.cpp b/indra/newview/llcommandlineparser.cpp index fe14bc081f2f6cbcf4473c4b75ac276b583018ae..0074e36593421df046689e5599eda6a2efe70bbc 100644 --- a/indra/newview/llcommandlineparser.cpp +++ b/indra/newview/llcommandlineparser.cpp @@ -302,19 +302,19 @@ bool LLCommandLineParser::parseAndStoreResults(po::command_line_parser& clp) po::basic_parsed_options<char> opts = clp.run(); po::store(opts, gVariableMap); } - catch(po::error& e) + catch(const po::error& e) { LL_WARNS() << "Caught Error:" << e.what() << LL_ENDL; mErrorMsg = e.what(); return false; } - catch(LLCLPError& e) + catch(const LLCLPError& e) { LL_WARNS() << "Caught Error:" << e.what() << LL_ENDL; mErrorMsg = e.what(); return false; } - catch(LLCLPLastOption&) + catch(const LLCLPLastOption&) { // This exception means a token was read after an option // that must be the last option was reached (see url and slurl options) diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index 76e16f5a1fffef3ac7445260f02268a28a2773a9..200a04d49cc13deff476cb2eede2aa2c095b62de 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -802,7 +802,7 @@ void LLFloaterScriptQueue::objectScriptProcessingQueueCoro(std::string action, L floater->addStringMessage("Done"); floater->getChildView("close")->setEnabled(TRUE); } - catch (LLCheckedHandleBase::Stale &) + catch (const LLCheckedHandleBase::Stale &) { // This is expected. It means that floater has been closed before // processing was completed. diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp index 7c41468b779edef9f3fe8200f116d274f6dc0897..fbd069a54d5d9945bab26d89d783ee300d9617ce 100644 --- a/indra/newview/llimprocessing.cpp +++ b/indra/newview/llimprocessing.cpp @@ -396,7 +396,7 @@ static bool parse_lure_bucket(const std::string& bucket, ly = boost::lexical_cast<S32>((*(++iter)).c_str()); lz = boost::lexical_cast<S32>((*(++iter)).c_str()); } - catch (boost::bad_lexical_cast&) + catch (const boost::bad_lexical_cast&) { LL_WARNS("parse_lure_bucket") << "Couldn't parse lure bucket." diff --git a/indra/newview/llmainlooprepeater.cpp b/indra/newview/llmainlooprepeater.cpp index 6736e9a950d500d7d71aa119997e78d01a1e8bc3..7c580252aa59d765be919e3a1305b6dc32218d43 100644 --- a/indra/newview/llmainlooprepeater.cpp +++ b/indra/newview/llmainlooprepeater.cpp @@ -80,7 +80,7 @@ bool LLMainLoopRepeater::onMessage(LLSD const & event) { try { mQueue->pushFront(event); - } catch(LLThreadSafeQueueError & e) { + } catch(const LLThreadSafeQueueError & e) { LL_WARNS() << "could not repeat message (" << e.what() << ")" << event.asString() << LL_ENDL; } diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 84c189f4988c04b3f82f276fbe561d928439a006..b5cbc01214a0fcb29fadf757ea5879b0b0a15831 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -1919,7 +1919,7 @@ EMeshProcessingResult LLMeshRepoThread::lodReceived(const LLVolumeParams& mesh_p std::string mesh_string((char*)data, data_size); stream.str(mesh_string); } - catch (std::bad_alloc) + catch (const std::bad_alloc&) { // out of memory, we won't be able to process this mesh return MESH_OUT_OF_MEMORY; diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 224cec9650ef444e04cbfde527919ef86cabc81b..e440071cf7fa75e47506348c6276282b9a00d9ec 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -999,7 +999,7 @@ void LLPanelLogin::onClickConnect(void *) { LLGridManager::getInstance()->setGridChoice(combo_val.asString()); } - catch (LLInvalidGridName ex) + catch (const LLInvalidGridName& ex) { LLSD args; args["GRID"] = ex.name(); @@ -1206,7 +1206,7 @@ void LLPanelLogin::updateServer() // grid changed so show new splash screen (possibly) loadLoginPage(); } - catch (LLInvalidGridName ex) + catch (const LLInvalidGridName& ex) { LL_WARNS("AppInit")<<"server '"<<ex.name()<<"' selection failed"<<LL_ENDL; LLSD args; diff --git a/indra/newview/llsecapi.cpp b/indra/newview/llsecapi.cpp index 72d7cf1e4522eebcf56bfb455976d79dd7abc000..0ef13d974185e99552b38a62a0c7af1567c96e62 100644 --- a/indra/newview/llsecapi.cpp +++ b/indra/newview/llsecapi.cpp @@ -64,7 +64,7 @@ void initializeSecHandler() { handler->init(); } - catch (LLProtectedDataException e) + catch (const LLProtectedDataException& e) { exception_msg = e.what(); } diff --git a/indra/newview/llsechandler_basic.cpp b/indra/newview/llsechandler_basic.cpp index 55e49100c3538a9bfb9ad2e80cf6d00a63626dcd..53888626e569b6c70d11cead8c71fe0cc45fe536 100644 --- a/indra/newview/llsechandler_basic.cpp +++ b/indra/newview/llsechandler_basic.cpp @@ -605,7 +605,7 @@ void LLBasicCertificateStore::load_from_file(const std::string& filename) << LL_ENDL; loaded++; } - catch (LLCertException& cert_exception) + catch (const LLCertException& cert_exception) { LLSD cert_info(cert_exception.getCertData()); LL_DEBUGS("SECAPI_BADCERT","SECAPI") << "invalid certificate (" << cert_exception.what() << "): " << cert_info << LL_ENDL; diff --git a/indra/newview/llviewernetwork.h b/indra/newview/llviewernetwork.h index b8ff494b8b0d27e79d997dc8d47cea4020d14062..4c87720374d21d4ffd5471c6b204dd50bcdef7c0 100644 --- a/indra/newview/llviewernetwork.h +++ b/indra/newview/llviewernetwork.h @@ -38,7 +38,7 @@ class LLInvalidGridName LLInvalidGridName(std::string grid) : mGrid(grid) { } - std::string name() { return mGrid; } + std::string name() const { return mGrid; } protected: std::string mGrid; };