diff options
author | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-10-23 16:37:15 +0300 |
---|---|---|
committer | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-10-23 16:37:15 +0300 |
commit | 1b4d5492c6f4aef54bc51e34c05b270bded584f5 (patch) | |
tree | a2922c1b65a0e31f9f3876873f6a3d4760a0afc9 | |
parent | d2460621169c38f531f5a6f781068f111184a9ac (diff) |
SL-11727 Fix build warnings
-rwxr-xr-x | doc/contributions.txt | 1 | ||||
-rw-r--r-- | indra/llaudio/llaudiodecodemgr.cpp | 2 | ||||
-rw-r--r-- | indra/llcommon/llsdserialize.cpp | 2 | ||||
-rw-r--r-- | indra/llcorehttp/_httpservice.cpp | 2 | ||||
-rw-r--r-- | indra/llcorehttp/bufferarray.cpp | 2 | ||||
-rw-r--r-- | indra/llimage/llimagejpeg.cpp | 2 | ||||
-rw-r--r-- | indra/llimage/llpngwrapper.cpp | 2 | ||||
-rw-r--r-- | indra/llmath/llvolume.cpp | 31 | ||||
-rw-r--r-- | indra/llmessage/llcorehttputil.cpp | 4 | ||||
-rw-r--r-- | indra/llmessage/llhttpnode.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llappviewer.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llmeshrepository.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llsecapi.cpp | 2 |
13 files changed, 39 insertions, 25 deletions
diff --git a/doc/contributions.txt b/doc/contributions.txt index ca2e63cf9f..c6ad23dc2c 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -347,6 +347,7 @@ Charles Courtois Charlie Sazaland Chaser Zaks BUG-225599 + BUG-227485 Cherry Cheevers ChickyBabes Zuzu Christopher Organiser diff --git a/indra/llaudio/llaudiodecodemgr.cpp b/indra/llaudio/llaudiodecodemgr.cpp index 6ab61689fd..e7db84f6ab 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 (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 1aaff5628f..0bae59ef4c 100644 --- a/indra/llcommon/llsdserialize.cpp +++ b/indra/llcommon/llsdserialize.cpp @@ -2241,7 +2241,7 @@ LLUZipHelper::EZipRresult LLUZipHelper::unzip_llsd(LLSD& data, std::istream& is, return ZR_SIZE_ERROR; } #endif - catch (std::bad_alloc) + catch (std::bad_alloc&) { free(result); return ZR_MEM_ERROR; diff --git a/indra/llcorehttp/_httpservice.cpp b/indra/llcorehttp/_httpservice.cpp index 0b72b53186..34268d94f6 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 (std::bad_alloc&) { LLMemory::logMemoryInfo(TRUE); diff --git a/indra/llcorehttp/bufferarray.cpp b/indra/llcorehttp/bufferarray.cpp index be534b3ce4..e0b2876a00 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 (std::bad_alloc&) { LLMemory::logMemoryInfo(TRUE); diff --git a/indra/llimage/llimagejpeg.cpp b/indra/llimage/llimagejpeg.cpp index 3b1b060c02..ead9a37fb8 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 (std::bad_alloc&) { setLastError( "Out of memory"); jpeg_destroy_decompress(&cinfo); diff --git a/indra/llimage/llpngwrapper.cpp b/indra/llimage/llpngwrapper.cpp index f298764cc0..f7dc6272cf 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 (std::bad_alloc&) { mErrorMessage = "LLPngWrapper"; releaseResources(); diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index e7a8ca2f9d..ac02364a67 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -2400,9 +2400,9 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size) { //face has no geometry, continue face.resizeIndices(3); face.resizeVertices(1); - memset(face.mPositions, 0, sizeof(LLVector4a)); - memset(face.mNormals, 0, sizeof(LLVector4a)); - memset(face.mTexCoords, 0, sizeof(LLVector2)); + face.mPositions->clear(); + face.mNormals->clear(); + face.mTexCoords->setZero(); memset(face.mIndices, 0, sizeof(U16)*3); continue; } @@ -2490,7 +2490,11 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size) } else { - memset(norm_out, 0, sizeof(LLVector4a)*num_verts); + for (U32 j = 0; j < num_verts; ++j) + { + norm_out->clear(); + norm_out++; // or just norm_out[j].clear(); + } } } @@ -2520,7 +2524,11 @@ bool LLVolume::unpackVolumeFaces(std::istream& is, S32 size) } else { - memset(tc_out, 0, sizeof(LLVector2)*num_verts); + for (U32 j = 0; j < num_verts; j += 2) + { + tc_out->clear(); + tc_out++; + } } } @@ -5252,7 +5260,7 @@ bool LLVolumeFace::cacheOptimize() triangle_data.resize(mNumIndices / 3); vertex_data.resize(mNumVertices); } - catch (std::bad_alloc) + catch (std::bad_alloc&) { LL_WARNS("LLVOLUME") << "Resize failed" << LL_ENDL; return false; @@ -5406,7 +5414,7 @@ bool LLVolumeFace::cacheOptimize() { new_idx.resize(mNumVertices, -1); } - catch (std::bad_alloc) + catch (std::bad_alloc&) { ll_aligned_free<64>(pos); ll_aligned_free_16(wght); @@ -6914,11 +6922,16 @@ void CalculateTangentArray(U32 vertexCount, const LLVector4a *vertex, const LLVe { //LLVector4a *tan1 = new LLVector4a[vertexCount * 2]; LLVector4a* tan1 = (LLVector4a*) ll_aligned_malloc_16(vertexCount*2*sizeof(LLVector4a)); + // new(tan1) LLVector4a; LLVector4a* tan2 = tan1 + vertexCount; - memset(tan1, 0, vertexCount*2*sizeof(LLVector4a)); - + U32 count = vertexCount * 2; + for (U32 i = 0; i < count; i++) + { + tan1[i].clear(); + } + for (U32 a = 0; a < triangleCount; a++) { U32 i1 = *index_array++; diff --git a/indra/llmessage/llcorehttputil.cpp b/indra/llmessage/llcorehttputil.cpp index 24387fbffd..0eae6d9826 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 (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 (std::runtime_error&) { success = false; return LLSD(); diff --git a/indra/llmessage/llhttpnode.cpp b/indra/llmessage/llhttpnode.cpp index 04b34a296c..6fd17c9154 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 (NotImplemented&) { response->methodNotAllowed(); } @@ -138,7 +138,7 @@ void LLHTTPNode::put(LLHTTPNode::ResponsePtr response, const LLSD& context, cons { response->result(simplePut(input)); } - catch (NotImplemented) + catch (NotImplemented&) { response->methodNotAllowed(); } @@ -151,7 +151,7 @@ void LLHTTPNode::post(LLHTTPNode::ResponsePtr response, const LLSD& context, con { response->result(simplePost(input)); } - catch (NotImplemented) + catch (NotImplemented&) { response->methodNotAllowed(); } @@ -164,7 +164,7 @@ void LLHTTPNode::del(LLHTTPNode::ResponsePtr response, const LLSD& context) cons { response->result(simpleDel(context)); } - catch (NotImplemented) + catch (NotImplemented&) { response->methodNotAllowed(); } diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index c9953566fc..7539d147ae 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1136,7 +1136,7 @@ bool LLAppViewer::init() try { initializeSecHandler(); } - catch (LLProtectedDataException ex) + catch (LLProtectedDataException&) { LLNotificationsUtil::add("CorruptedProtectedDataStore"); } @@ -1352,7 +1352,7 @@ bool LLAppViewer::frame() { LOG_UNHANDLED_EXCEPTION(""); } - catch (std::bad_alloc) + catch (std::bad_alloc&) { LLMemory::logMemoryInfo(TRUE); LLFloaterMemLeak* mem_leak_instance = LLFloaterReg::findTypedInstance<LLFloaterMemLeak>("mem_leaking"); diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 95322cce6d..ce41e2bd35 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -1889,7 +1889,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 (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/llsecapi.cpp b/indra/newview/llsecapi.cpp index 72d7cf1e45..10e510b842 100644 --- a/indra/newview/llsecapi.cpp +++ b/indra/newview/llsecapi.cpp @@ -64,7 +64,7 @@ void initializeSecHandler() { handler->init(); } - catch (LLProtectedDataException e) + catch (LLProtectedDataException& e) { exception_msg = e.what(); } |