diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2024-06-09 00:48:45 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-09 00:48:45 +0300 |
commit | 22d3ea34f29bc11f3e5bfe491f4bc0895e1d4653 (patch) | |
tree | 6c8e4f460f9d0ab2684e21a63f9ecd921eb45024 /indra/llrender | |
parent | 69b48fd13adb129bfa56eaf81309e10eaa16a023 (diff) | |
parent | 395c1c6adf1ecb669f805d5244772b080c077cce (diff) |
Merge pull request #1613 from Ansariel/DRTVWR-600-maint-A
Fix/re-enable MSVC compiler warnings
Diffstat (limited to 'indra/llrender')
-rw-r--r-- | indra/llrender/llfontbitmapcache.cpp | 2 | ||||
-rw-r--r-- | indra/llrender/llfontbitmapcache.h | 2 | ||||
-rw-r--r-- | indra/llrender/llfontfreetype.cpp | 2 | ||||
-rw-r--r-- | indra/llrender/llfontgl.cpp | 2 | ||||
-rw-r--r-- | indra/llrender/llglslshader.cpp | 4 | ||||
-rw-r--r-- | indra/llrender/llglslshader.h | 4 | ||||
-rw-r--r-- | indra/llrender/llrendertarget.cpp | 10 | ||||
-rw-r--r-- | indra/llrender/llshadermgr.cpp | 2 |
8 files changed, 14 insertions, 14 deletions
diff --git a/indra/llrender/llfontbitmapcache.cpp b/indra/llrender/llfontbitmapcache.cpp index d2c40ad590..46c2e89797 100644 --- a/indra/llrender/llfontbitmapcache.cpp +++ b/indra/llrender/llfontbitmapcache.cpp @@ -108,7 +108,7 @@ bool LLFontBitmapCache::nextOpenPos(S32 width, S32& pos_x, S32& pos_y, EFontGlyp S32 num_components = getNumComponents(bitmap_type); mImageRawVec[bitmap_idx].push_back(new LLImageRaw(mBitmapWidth, mBitmapHeight, num_components)); - bitmap_num = mImageRawVec[bitmap_idx].size() - 1; + bitmap_num = static_cast<U32>(mImageRawVec[bitmap_idx].size()) - 1; LLImageRaw* image_raw = getImageRaw(bitmap_type, bitmap_num); if (EFontGlyphType::Grayscale == bitmap_type) diff --git a/indra/llrender/llfontbitmapcache.h b/indra/llrender/llfontbitmapcache.h index 6b19ba2154..f2dfd87877 100644 --- a/indra/llrender/llfontbitmapcache.h +++ b/indra/llrender/llfontbitmapcache.h @@ -60,7 +60,7 @@ public: LLImageGL* getImageGL(EFontGlyphType bitmapType, U32 bitmapNum) const; S32 getMaxCharWidth() const { return mMaxCharWidth; } - U32 getNumBitmaps(EFontGlyphType bitmapType) const { return (bitmapType < EFontGlyphType::Count) ? mImageRawVec[static_cast<U32>(bitmapType)].size() : 0; } + U32 getNumBitmaps(EFontGlyphType bitmapType) const { return (bitmapType < EFontGlyphType::Count) ? static_cast<U32>(mImageRawVec[static_cast<U32>(bitmapType)].size()) : 0U; } S32 getBitmapWidth() const { return mBitmapWidth; } S32 getBitmapHeight() const { return mBitmapHeight; } diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp index 94b576885f..741ed993b0 100644 --- a/indra/llrender/llfontfreetype.cpp +++ b/indra/llrender/llfontfreetype.cpp @@ -328,7 +328,7 @@ S32 LLFontFreetype::ftOpenFace(const std::string& filename, S32 face_n) pFtStream = new LLFT_Stream(); pFtStream->base = 0; pFtStream->pos = 0; - pFtStream->size = file_size; + pFtStream->size = static_cast<unsigned long>(file_size); pFtStream->descriptor.pointer = pFileStream; pFtStream->read = ft_read_cb; pFtStream->close = ft_close_cb; diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index 25706c77eb..7e10a4e159 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -149,7 +149,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons if(!sDisplayFont) //do not display texts { - return wstr.length() ; + return static_cast<S32>(wstr.length()); } if (wstr.empty()) diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 1651835b59..2caeb1c431 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -621,7 +621,7 @@ bool LLGLSLShader::mapAttributes(const std::vector<LLStaticHashedString>* attrib } mAttribute.clear(); - U32 numAttributes = (attributes == NULL) ? 0 : attributes->size(); + U32 numAttributes = (attributes == NULL) ? 0U : static_cast<U32>(attributes->size()); #if LL_RELEASE_WITH_DEBUG_INFO mAttribute.resize(LLShaderMgr::instance()->mReservedAttribs.size() + numAttributes, { -1, NULL }); #else @@ -843,7 +843,7 @@ bool LLGLSLShader::mapUniforms(const vector<LLStaticHashedString>* uniforms) mTexture.clear(); mValue.clear(); //initialize arrays - U32 numUniforms = (uniforms == NULL) ? 0 : uniforms->size(); + U32 numUniforms = (uniforms == NULL) ? 0U : static_cast<U32>(uniforms->size()); mUniform.resize(numUniforms + LLShaderMgr::instance()->mReservedUniforms.size(), -1); mTexture.resize(numUniforms + LLShaderMgr::instance()->mReservedUniforms.size(), -1); diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h index 95e8f1168a..698da92877 100644 --- a/indra/llrender/llglslshader.h +++ b/indra/llrender/llglslshader.h @@ -68,8 +68,8 @@ public: template<typename T> struct UniformSetting { - S32 mUniform; - T mValue; + S32 mUniform{ 0 }; + T mValue{}; }; typedef UniformSetting<S32> IntSetting; diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index 8c05a47c39..bd64ba84fb 100644 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp @@ -208,7 +208,7 @@ bool LLRenderTarget::addColorAttachment(U32 color_fmt) return true; } - U32 offset = mTex.size(); + U32 offset = static_cast<U32>(mTex.size()); if( offset >= 4 ) { @@ -378,11 +378,11 @@ void LLRenderTarget::release() if (mFBO && (mTex.size() > 1)) { glBindFramebuffer(GL_FRAMEBUFFER, mFBO); - S32 z; + size_t z; for (z = mTex.size() - 1; z >= 1; z--) { sBytesAllocated -= mResX*mResY*4; - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0+z, LLTexUnit::getInternalType(mUsage), 0, 0); + glFramebufferTexture2D(GL_FRAMEBUFFER, static_cast<GLenum>(GL_COLOR_ATTACHMENT0+z), LLTexUnit::getInternalType(mUsage), 0, 0); LLImageGL::deleteTextures(1, &mTex[z]); } glBindFramebuffer(GL_FRAMEBUFFER, sCurFBO); @@ -426,7 +426,7 @@ void LLRenderTarget::bindTarget() GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2, GL_COLOR_ATTACHMENT3}; - glDrawBuffers(mTex.size(), drawbuffers); + glDrawBuffers(static_cast<GLsizei>(mTex.size()), drawbuffers); if (mTex.empty()) { //no color buffer to draw to @@ -485,7 +485,7 @@ U32 LLRenderTarget::getTexture(U32 attachment) const U32 LLRenderTarget::getNumTextures() const { - return mTex.size(); + return static_cast<U32>(mTex.size()); } void LLRenderTarget::bindTexture(U32 index, S32 channel, LLTexUnit::eTextureFilterOptions filter_options) diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 98bfb38f03..6ac2b62777 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -1096,7 +1096,7 @@ bool LLShaderMgr::saveCachedProgramBinary(LLGLSLShader* shader) program_binary.resize(binary_info.mBinaryLength); GLenum error = glGetError(); // Clear current error - glGetProgramBinary(shader->mProgramObject, program_binary.size() * sizeof(U8), nullptr, &binary_info.mBinaryFormat, program_binary.data()); + glGetProgramBinary(shader->mProgramObject, static_cast<GLsizei>(program_binary.size() * sizeof(U8)), nullptr, &binary_info.mBinaryFormat, program_binary.data()); error = glGetError(); if (error == GL_NO_ERROR) { |