diff options
| author | Ansariel Hiller <Ansariel@users.noreply.github.com> | 2024-09-09 12:02:34 +0200 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-09 13:02:34 +0300 | 
| commit | d91d39fa0f7f4f204d6fb7ff66b9817e498dbd61 (patch) | |
| tree | 467806f61646cd62b195143cb89f384a472e34bf | |
| parent | 2f692fbac36117e1b3c5f2ec214fd188c7e73da7 (diff) | |
Changes towards C++20 compatibility (#2520)
| -rw-r--r-- | indra/llcommon/llapp.cpp | 2 | ||||
| -rw-r--r-- | indra/llcommon/llmainthreadtask.h | 4 | ||||
| -rw-r--r-- | indra/llcommon/llpointer.h | 11 | ||||
| -rw-r--r-- | indra/llcommon/llpredicate.h | 4 | ||||
| -rw-r--r-- | indra/llcorehttp/tests/test_httpoperation.hpp | 2 | ||||
| -rw-r--r-- | indra/llui/llviewereventrecorder.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/lldeferredsounds.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/lldeferredsounds.h | 3 | ||||
| -rw-r--r-- | indra/newview/lldrawpoolalpha.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/llspatialpartition.cpp | 4 | ||||
| -rw-r--r-- | indra/newview/llspatialpartition.h | 2 | ||||
| -rw-r--r-- | indra/newview/llviewertexteditor.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/llvograss.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/llvopartgroup.cpp | 2 | 
14 files changed, 26 insertions, 18 deletions
| diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index 6da764f94c..3db03aec7d 100644 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -226,7 +226,7 @@ bool LLApp::parseCommandOptions(int argc, wchar_t** wargv)          if(wargv[ii][0] != '-')          {              LL_INFOS() << "Did not find option identifier while parsing token: " -                << wargv[ii] << LL_ENDL; +                << (intptr_t)wargv[ii] << LL_ENDL;              return false;          }          int offset = 1; diff --git a/indra/llcommon/llmainthreadtask.h b/indra/llcommon/llmainthreadtask.h index cec95b2356..c3ed7fef52 100644 --- a/indra/llcommon/llmainthreadtask.h +++ b/indra/llcommon/llmainthreadtask.h @@ -89,10 +89,10 @@ private:          }          // Given arbitrary CALLABLE, which might be a lambda, how are we          // supposed to obtain its signature for std::packaged_task? It seems -        // redundant to have to add an argument list to engage result_of, then +        // redundant to have to add an argument list to engage invoke_result_t, then          // add the argument list again to complete the signature. At least we          // only support a nullary CALLABLE. -        std::packaged_task<typename std::result_of<CALLABLE()>::type()> mTask; +        std::packaged_task<std::invoke_result_t<CALLABLE>()> mTask;      };  }; diff --git a/indra/llcommon/llpointer.h b/indra/llcommon/llpointer.h index 6edff9fa5e..048547e4cc 100644 --- a/indra/llcommon/llpointer.h +++ b/indra/llcommon/llpointer.h @@ -418,6 +418,17 @@ private:      bool mStayUnique;  }; +template<typename Type> +bool operator!=(Type* lhs, const LLPointer<Type>& rhs) +{ +    return (lhs != rhs.get()); +} + +template<typename Type> +bool operator==(Type* lhs, const LLPointer<Type>& rhs) +{ +    return (lhs == rhs.get()); +}  // boost hash adapter  template <class Type> diff --git a/indra/llcommon/llpredicate.h b/indra/llcommon/llpredicate.h index 7c6874d279..91c623eae1 100644 --- a/indra/llcommon/llpredicate.h +++ b/indra/llcommon/llpredicate.h @@ -139,7 +139,7 @@ namespace LLPredicate          Rule()          {} -        void require(ENUM e, bool match) +        void mandate(ENUM e, bool match)          {              mRule.set(e, match);          } @@ -154,7 +154,7 @@ namespace LLPredicate              return (mRule && value).someSet();          } -        bool requires(const Value<ENUM> value) const +        bool mandates(const Value<ENUM> value) const          {              return (mRule && value).someSet() && (!mRule && value).noneSet();          } diff --git a/indra/llcorehttp/tests/test_httpoperation.hpp b/indra/llcorehttp/tests/test_httpoperation.hpp index 6778c3440b..361091c7b2 100644 --- a/indra/llcorehttp/tests/test_httpoperation.hpp +++ b/indra/llcorehttp/tests/test_httpoperation.hpp @@ -92,7 +92,7 @@ namespace tut          op->setReplyPath(LLCore::HttpOperation::HttpReplyQueuePtr_t(), h1);          // Check ref count -        ensure(op.unique() == 1); +        ensure(op.use_count() == 1);          // release the reference, releasing the operation but          // not the handlers. diff --git a/indra/llui/llviewereventrecorder.cpp b/indra/llui/llviewereventrecorder.cpp index e5e0545dad..6d907d7e45 100644 --- a/indra/llui/llviewereventrecorder.cpp +++ b/indra/llui/llviewereventrecorder.cpp @@ -261,7 +261,7 @@ void LLViewerEventRecorder::logKeyUnicodeEvent(llwchar uni_char) {    event.insert("event",LLSD("keyDown")); -  LL_DEBUGS()  << "[VITA] unicode key: " << uni_char   << LL_ENDL; +  LL_DEBUGS()  << "[VITA] unicode key: " << (int)uni_char   << LL_ENDL;    LL_DEBUGS()  << "[VITA] dumpxml " << LLSDXMLStreamer(event) << "\n" << LL_ENDL; diff --git a/indra/newview/lldeferredsounds.cpp b/indra/newview/lldeferredsounds.cpp index 8b7c399af1..44f51545dc 100644 --- a/indra/newview/lldeferredsounds.cpp +++ b/indra/newview/lldeferredsounds.cpp @@ -29,8 +29,6 @@  #include "lldeferredsounds.h" -#include "llaudioengine.h" -  void LLDeferredSounds::deferSound(SoundData& sound)  {      soundVector.push_back(sound); diff --git a/indra/newview/lldeferredsounds.h b/indra/newview/lldeferredsounds.h index e586226184..9f3425fc66 100644 --- a/indra/newview/lldeferredsounds.h +++ b/indra/newview/lldeferredsounds.h @@ -28,8 +28,7 @@  #define LL_LLDEFERREDSOUNDS_H  #include "llsingleton.h" - -struct SoundData; +#include "llaudioengine.h"  class LLDeferredSounds : public LLSingleton<LLDeferredSounds>  { diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index b4d14e22f3..87b6ce6cb3 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -757,7 +757,7 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, bool depth_only, bool rigged)                      if (current_shader)                      { -                        current_shader->uniform4f(LLShaderMgr::SPECULAR_COLOR, spec_color.mV[0], spec_color.mV[1], spec_color.mV[2], spec_color.mV[3]); +                        current_shader->uniform4f(LLShaderMgr::SPECULAR_COLOR, spec_color.mV[VRED], spec_color.mV[VGREEN], spec_color.mV[VBLUE], spec_color.mV[VALPHA]);                          current_shader->uniform1f(LLShaderMgr::ENVIRONMENT_INTENSITY, env_intensity);                          current_shader->uniform1f(LLShaderMgr::EMISSIVE_BRIGHTNESS, brightness);                      } diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index e517d009f5..a1a67c319c 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -300,7 +300,7 @@ bool LLSpatialGroup::addObject(LLDrawable *drawablep)      }      {          drawablep->setGroup(this); -        setState(OBJECT_DIRTY | GEOM_DIRTY); +        setState(static_cast<U32>(OBJECT_DIRTY) | static_cast<U32>(GEOM_DIRTY));          setOcclusionState(LLSpatialGroup::DISCARD_QUERY, LLSpatialGroup::STATE_MODE_ALL_CAMERAS);          gPipeline.markRebuild(this);          if (drawablep->isSpatialBridge()) @@ -730,7 +730,7 @@ bool LLSpatialGroup::changeLOD()  {      LL_PROFILE_ZONE_SCOPED_CATEGORY_SPATIAL; -    if (hasState(ALPHA_DIRTY | OBJECT_DIRTY)) +    if (hasState(static_cast<U32>(ALPHA_DIRTY) | static_cast<U32>(OBJECT_DIRTY)))      {          //a rebuild is going to happen, update distance and LoD          return true; diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index c074d6a89a..3aaa3d60e8 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -47,7 +47,7 @@  #include <unordered_map>  #define SG_STATE_INHERIT_MASK (OCCLUDED) -#define SG_INITIAL_STATE_MASK (DIRTY | GEOM_DIRTY) +#define SG_INITIAL_STATE_MASK (static_cast<U32>(DIRTY) | static_cast<U32>(GEOM_DIRTY))  class LLViewerOctreePartition;  class LLSpatialPartition; diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 14228b469f..5793a28b80 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -503,7 +503,7 @@ S32 LLEmbeddedItems::getIndexFromEmbeddedChar(llwchar wch)      }      else      { -        LL_WARNS() << "Embedded char " << wch << " not found, using 0" << LL_ENDL; +        LL_WARNS() << "Embedded char " << (int)wch << " not found, using 0" << LL_ENDL;          return 0;      }  } diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index 6903af2619..67adcbb244 100644 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -596,7 +596,7 @@ U32 LLVOGrass::getPartitionType() const  }  LLGrassPartition::LLGrassPartition(LLViewerRegion* regionp) -: LLSpatialPartition(LLDrawPoolAlpha::VERTEX_DATA_MASK | LLVertexBuffer::MAP_TEXTURE_INDEX, true, regionp) +: LLSpatialPartition(static_cast<U32>(LLDrawPoolAlpha::VERTEX_DATA_MASK) | static_cast<U32>(LLVertexBuffer::MAP_TEXTURE_INDEX), true, regionp)  {      mDrawableType = LLPipeline::RENDER_TYPE_GRASS;      mPartitionType = LLViewerRegion::PARTITION_GRASS; diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp index 81f16cf8cb..8f792c1042 100644 --- a/indra/newview/llvopartgroup.cpp +++ b/indra/newview/llvopartgroup.cpp @@ -702,7 +702,7 @@ U32 LLVOPartGroup::getPartitionType() const  }  LLParticlePartition::LLParticlePartition(LLViewerRegion* regionp) -: LLSpatialPartition(LLDrawPoolAlpha::VERTEX_DATA_MASK | LLVertexBuffer::MAP_TEXTURE_INDEX, true, regionp) +: LLSpatialPartition(static_cast<U32>(LLDrawPoolAlpha::VERTEX_DATA_MASK) | static_cast<U32>(LLVertexBuffer::MAP_TEXTURE_INDEX), true, regionp)  {      mRenderPass = LLRenderPass::PASS_ALPHA;      mDrawableType = LLPipeline::RENDER_TYPE_PARTICLES; | 
