From c0fad3028fd55c2067ce6a0ae4382cffe1014284 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 10 Jun 2024 16:42:43 +0200 Subject: Re-enable compiler warnings C4018, C4100, C4231 and C4506 --- indra/llcommon/llalignedarray.h | 4 ++-- indra/llcommon/llleap.cpp | 2 +- indra/llcommon/llpreprocessor.h | 6 ------ indra/llcommon/llsingleton.h | 4 ++++ indra/llcommon/llstreamqueue.h | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) (limited to 'indra/llcommon') diff --git a/indra/llcommon/llalignedarray.h b/indra/llcommon/llalignedarray.h index 0ba8b34cb6..8248f82186 100644 --- a/indra/llcommon/llalignedarray.h +++ b/indra/llcommon/llalignedarray.h @@ -116,7 +116,7 @@ void LLAlignedArray::resize(U32 size) template T& LLAlignedArray::operator[](int idx) { - if(idx >= mElementCount || idx < 0) + if (idx < 0 || unsigned(idx) >= mElementCount) { LL_ERRS() << "Out of bounds LLAlignedArray, requested: " << (S32)idx << " size: " << mElementCount << LL_ENDL; } @@ -126,7 +126,7 @@ T& LLAlignedArray::operator[](int idx) template const T& LLAlignedArray::operator[](int idx) const { - if (idx >= mElementCount || idx < 0) + if (idx < 0 || unsigned(idx) >= mElementCount) { LL_ERRS() << "Out of bounds LLAlignedArray, requested: " << (S32)idx << " size: " << mElementCount << LL_ENDL; } diff --git a/indra/llcommon/llleap.cpp b/indra/llcommon/llleap.cpp index e93ba83434..662a2511cd 100644 --- a/indra/llcommon/llleap.cpp +++ b/indra/llcommon/llleap.cpp @@ -233,7 +233,7 @@ public: LL_DEBUGS("EventHost") << "Sending: " << static_cast(buffer.tellp()) << ':'; - std::string::size_type truncate(80); + llssize truncate(80); if (buffer.tellp() <= truncate) { LL_CONT << buffer.str(); diff --git a/indra/llcommon/llpreprocessor.h b/indra/llcommon/llpreprocessor.h index 0c5799ad96..65ecd573e4 100644 --- a/indra/llcommon/llpreprocessor.h +++ b/indra/llcommon/llpreprocessor.h @@ -124,12 +124,7 @@ #if LL_MSVC #pragma warning( disable : 4996 ) // warning: deprecated -// Linker optimization with "extern template" generates these warnings -#pragma warning( disable : 4231 ) // nonstandard extension used : 'extern' before template explicit instantiation -#pragma warning( disable : 4506 ) // no definition for inline function - // level 4 warnings that we need to disable: -#pragma warning (disable : 4100) // unreferenced formal parameter #pragma warning (disable : 4127) // conditional expression is constant (e.g. while(1) ) #pragma warning (disable : 4244) // possible loss of data on conversions #pragma warning (disable : 4396) // the inline specifier cannot be used when a friend declaration refers to a specialization of a function template @@ -138,7 +133,6 @@ #pragma warning (disable : 4251) // member needs to have dll-interface to be used by clients of class #pragma warning (disable : 4275) // non dll-interface class used as base for dll-interface class -#pragma warning (disable : 4018) // '<' : signed/unsigned mismatch #endif // LL_MSVC diff --git a/indra/llcommon/llsingleton.h b/indra/llcommon/llsingleton.h index 0a7086e819..5952cbdd87 100644 --- a/indra/llcommon/llsingleton.h +++ b/indra/llcommon/llsingleton.h @@ -36,6 +36,10 @@ #include "llthread.h" // on_main_thread() #include "llmainthreadtask.h" +#ifdef LL_WINDOWS +#pragma warning( disable : 4506 ) // no definition for inline function +#endif + class LLSingletonBase: private boost::noncopyable { public: diff --git a/indra/llcommon/llstreamqueue.h b/indra/llcommon/llstreamqueue.h index a09bf4cb4b..01689457dd 100644 --- a/indra/llcommon/llstreamqueue.h +++ b/indra/llcommon/llstreamqueue.h @@ -216,7 +216,7 @@ std::streamsize LLGenericStreamQueue::skip(std::streamsize n) { typename BufferList::iterator bli(mBuffer.begin()), blend(mBuffer.end()); std::streamsize toskip(n), skipped(0); - while (bli != blend && toskip >= bli->length()) + while (bli != blend && (size_t)toskip >= bli->length()) { std::streamsize chunk(bli->length()); typename BufferList::iterator zap(bli++); -- cgit v1.2.3